From: sotrdg sotrdg <euloanty@live.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
"gcc-request@gcc.gnu.org" <gcc-request@gcc.gnu.org>,
"gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: RE: __builtin_addc support??
Date: Wed, 27 Oct 2021 23:23:46 +0000 [thread overview]
Message-ID: <CH2PR02MB6522320D60E3A210FB6A00E5B2859@CH2PR02MB6522.namprd02.prod.outlook.com> (raw)
In-Reply-To: <20211027231641.GZ614@gate.crashing.org>
HEY. ZERO COST ABSTRACTIONS lol
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
From: Segher Boessenkool<mailto:segher@kernel.crashing.org>
Sent: Wednesday, October 27, 2021 19:17
To: sotrdg sotrdg<mailto:euloanty@live.com>
Cc: gcc@gcc.gnu.org<mailto:gcc@gcc.gnu.org>; gcc-request@gcc.gnu.org<mailto:gcc-request@gcc.gnu.org>; gcc-help@gcc.gnu.org<mailto:gcc-help@gcc.gnu.org>
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
prev parent reply other threads:[~2021-10-27 23:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-27 16:12 sotrdg sotrdg
2021-10-27 16:36 ` Paul Koning
2021-10-27 16:54 ` sotrdg sotrdg
2021-10-27 23:16 ` Segher Boessenkool
2021-10-27 23:22 ` sotrdg sotrdg
2021-10-27 23:23 ` sotrdg sotrdg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CH2PR02MB6522320D60E3A210FB6A00E5B2859@CH2PR02MB6522.namprd02.prod.outlook.com \
--to=euloanty@live.com \
--cc=gcc-help@gcc.gnu.org \
--cc=gcc-request@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=segher@kernel.crashing.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).