public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Matthias Gehre <matthias.gehre@amd.com>,
	"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 15:23:36 +0000	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2205061517560.937576@digraph.polyomino.org.uk> (raw)
In-Reply-To: <YnU1C7ZyywuRJo+7@tucnak>

On Fri, 6 May 2022, Jakub Jelinek via Gcc wrote:

> And I really don't like the N + 1 stuff you're proposing, at least for
> _BigInts that would be represented as an array of those word etc. elements
> from least to most significant (or vice versa?  That really needs to be
> specified too), if they are same precision having to copy one of them just
> to get the extra scratch is bad.

Note that the proposed x86_64 ABI for _BitInt (branch usr/hjl/bitint) says 
that padding bits are unspecified.  That means that when the width isn't a 
multiple of the word size, either you need to copy to zero-extend / 
sign-extend (in the general case where a variable of _BitInt type is read 
from memory / function argument / ..., so the code doing arithmetic on it 
doesn't have any further information about the values of those bits that 
it might have if it had computed the value itself), even in the absence of 
needing to allocate extra memory or allowing the libgcc function to write 
to those arrays, or you need to pass in a width in bits (rather than a 
number of words) to the libgcc function so that it can tell which bits are 
padding.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2022-05-06 15:23 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 [this message]
2022-05-06 15:42   ` AW: " Matthias Gehre
2022-05-06 16:39     ` Jonathan Lennox
2022-05-06 18:05 ` Segher Boessenkool

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=alpine.DEB.2.22.394.2205061517560.937576@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --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).