Re: [committed] libstdc++: Optimise GCD algorithms

2020-09-07 Thread Jonathan Wakely via Gcc-patches
On 05/09/20 09:34 +0100, Jonathan Wakely via Libstdc++ wrote: On Sat, 5 Sep 2020 at 01:35, Sidney Marshall wrote: Jonathan I don't know if the following comments are useful or not but here goes: Reviews of my patches are always welcome, thanks. >The current std::gcd and std::chrono::dura

[committed] libstdc++: Optimise GCD algorithms

2020-09-03 Thread Jonathan Wakely via Gcc-patches
The current std::gcd and std::chrono::duration::_S_gcd algorithms are both recursive. This is potentially expensive to evaluate in constant expressions, because each level of recursion makes a new copy of the function to evaluate. The maximum number of steps is bounded (proportional to the number o