RE: __builtin_addc support??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HEY. ZERO COST ABSTRACTIONS lol

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

From: Segher Boessenkool<mailto:segher@xxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, October 27, 2021 19:17
To: sotrdg sotrdg<mailto:euloanty@xxxxxxxx>
Cc: gcc@xxxxxxxxxxx<mailto:gcc@xxxxxxxxxxx>; gcc-request@xxxxxxxxxxx<mailto:gcc-request@xxxxxxxxxxx>; gcc-help@xxxxxxxxxxx<mailto:gcc-help@xxxxxxxxxxx>
Subject: Re: __builtin_addc support??

On Wed, Oct 27, 2021 at 04:12:27PM +0000, sotrdg sotrdg via Gcc-help 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

Why?  We have __builtin_add_overflow, which is a smaller factor, and
enough to build up any bigger factors with.  You can easily write the
same thing in standard C of course, which often is a better plan.

If you want exact machine insns as output, write those, i.e., write
assembler code, not C.  Builtins are not there to please the "C is a
portable assembler" crowd: they are there to expose functionality you
cannot (conveniently) get using just pure standard C.


Segher





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux