public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Matthias Gehre <matthias.gehre@amd.com>
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: [RFC] Adding division/modulo on arbitrary precision integers to libgcc
Date: Fri, 6 May 2022 13:05:26 -0500	[thread overview]
Message-ID: <20220506180526.GL25951@gate.crashing.org> (raw)
In-Reply-To: <SA1PR02MB857379606D84DDC929D69D32A7C59@SA1PR02MB8573.namprd02.prod.outlook.com>

Hi!

On Fri, May 06, 2022 at 02:09:21PM +0000, Matthias Gehre via Gcc wrote:
> We would like to add support for division/modulo on large arbitrary precision integers to libgcc/compiler-rt
> as required by C23's _BitInt type [0].
> 
> >From what I know, gcc doesn't yet support C23 _BitInt, but we would still
> like to ensure that libgcc and compiler-rt can stay compatible in the future.

Why?  Why would that be useful at all?

libgcc is an implementation detail.  It is not meant to be used by
anything but GCC itself, and then only to implement things that aren't
implemented some other way (by target code typically).  The names of the
functions it implements are based on the GCC-internal RTL names, often
identical even.  Defining the libgcc names first is not only futile, but
also the wrong order.

Most functions in libgcc are a not-so-ideal-but-at-least-it-works
implementation that target maintainers who cannot be bothered to
implement this functionality more optimally can use.  Typically what you
really want is not a library routine at all!

As noted elsewhere (I forgot by whom, sorry) the target ABI will
probably have somemthing to say about the actual data representation,
so it is very counterproductive if we have something in libgcc that
does something else.


Segher

      parent reply	other threads:[~2022-05-06 18:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06 14:09 Matthias Gehre
2022-05-06 14:36 ` Joseph Myers
2022-05-06 15:57   ` AW: " Matthias Gehre
2022-05-06 16:02     ` Joseph Myers
2022-05-06 14:47 ` Jakub Jelinek
2022-05-06 15:23   ` Joseph Myers
2022-05-06 15:42   ` AW: " Matthias Gehre
2022-05-06 16:39     ` Jonathan Lennox
2022-05-06 18:05 ` Segher Boessenkool [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=20220506180526.GL25951@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gcc@gcc.gnu.org \
    --cc=matthias.gehre@amd.com \
    /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).