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
jos...@codesourcery.com

Reply via email to