Re: [match.pd PATCH] Fold ctz(-x) as ctz(x).

2024-07-23 Thread Jeff Law
On 7/23/24 10:30 AM, Roger Sayle wrote: The subject line pretty much says it all; the count-trailing-zeros function of -X produces the same result as count-trailing-zeros of X. This transformation eliminates a negation which may potentially overflow with an equivalent expression that doesn't

Re: [match.pd PATCH] Fold ctz(-x) as ctz(x).

2024-07-23 Thread Andrew Pinski
On Tue, Jul 23, 2024 at 9:30 AM Roger Sayle wrote: > > > The subject line pretty much says it all; the count-trailing-zeros function > of -X produces the same result as count-trailing-zeros of X. This > transformation eliminates a negation which may potentially overflow with > an equivalent expre

[match.pd PATCH] Fold ctz(-x) as ctz(x).

2024-07-23 Thread Roger Sayle
The subject line pretty much says it all; the count-trailing-zeros function of -X produces the same result as count-trailing-zeros of X. This transformation eliminates a negation which may potentially overflow with an equivalent expression that doesn't [much like the analogous abs(-X) simplificat