[PATCH] libstdc++: Optimize std::gcd

2024-06-06 Thread Stephen Face
This patch is to optimize the runtime execution of gcd. Mathematically, it computes with the same algorithm as before, but subtractions and branches are rearranged to encourage generation of code that can use flags from the subtractions for conditional moves. Additionally, most pairs of integers ar

Re: [PATCH] libstdc++: Optimize std::gcd

2024-06-07 Thread Stephen Face
On 6/7/24 2:30 AM, Jonathan Wakely wrote: > On Fri, 7 Jun 2024 at 09:57, Sam James wrote: >> >> Stephen Face writes: >> >>> This patch is to optimize the runtime execution of gcd. Mathematically, >>> it computes with the same algorithm as before, but subtr