On Fri, 6 May 2022, 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].

Note that each architecture also needs to specify its _BitInt ABI 
(including such things as whether the values of padding bits inside the 
size of the _BitInt type, or outside that size but within a register used 
for argument passing or return, have specified values or are arbitrary).  
HJ has a proposal for x86_64 on a branch of the ABI, but it hasn't been 
merged to master yet.

> /// Computes the unsigned division of a / b for two large integers
> /// composed of n significant words.
> /// Writes the quotient to quo and the remainder to rem.
> ///
> /// \param quo The quotient represented by n words. Must be non-null.
> /// \param rem The remainder represented by n words. Must be non-null.
> /// \param a The dividend represented by n + 1 words. Must be non-null.
> /// \param b The divisor represented by n words. Must be non-null.
> 
> /// \note The word order is in host endianness.
> /// \note Might modify a and b.
> /// \note The storage of 'a' needs to hold n + 1 elements because some
> ///       implementations need extra scratch space in the most significant 
> word.
> ///       The value of that word is ignored.

This proposed interface doesn't say anything about what aliasing is or 
isn't permitted among the four arrays pointed to.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to