Re: [PATCH] Correct implementation of wi::clz

2021-09-06 Thread Jeff Law via Gcc-patches
On 9/5/2021 3:39 PM, Roger Sayle wrote: As diagnosed with Jakub and Richard in the analysis of PR 102134, the current implementation of wi::clz has incorrect/inconsistent behaviour. As mentioned by Richard in comment #7, clz should (always) return zero for negative values, but the current impl

[PATCH] Correct implementation of wi::clz

2021-09-05 Thread Roger Sayle
As diagnosed with Jakub and Richard in the analysis of PR 102134, the current implementation of wi::clz has incorrect/inconsistent behaviour. As mentioned by Richard in comment #7, clz should (always) return zero for negative values, but the current implementation can only return 0 when precision