The mpn_divrem function in GMP/MPIR has been declared obsolete for several years now and there is a plan to remove it in MPIR 1.3.
However while mpn_divrem overwrites the input numerator with the output remainder, its proposed replacement - mpn_tdiv_qr - specifies a location for the remainder and also states that no memory overlaps are allowed between its operands. As a result, specifying the numerator as the location for the remainder in mpn_tdiv_qr is illegal and this forces the use of temporaries in any replacement of mpn_divrem with mpn_tdiv_qr. But in reality the current mpn_tdiv_qr code does allow the output remainder to replace the input numerator. Moreover a number of GMP and MPIR functions actually depend on this behaviour. In my view we should implement mpn_tdiv_qr in a way that allows the remainder to overwrite the numerator since this is often important for efficiency. Hence I would like to suggest that we change the documentation of mpn_tdiv_qr to allow this behaviour. Does anyone have a view on this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "mpir-devel" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/mpir-devel?hl=en -~----------~----~----~----~------~----~------~--~---
