Re: [PATCH] Simplify "1 - bool_val" to "bool_val ^ 1"

2023-02-12 Thread Jeff Law via Gcc-patches
On 1/31/23 18:21, Andrew Pinski via Gcc-patches wrote: For bool values, it is easier to deal with xor 1 rather than having 1 - a. This is because we are more likely to simplify the xor further in many cases. This is a special case for (MASK - b) where MASK is a powerof2 - 1 and b <= MASK but

Re: [PATCH] Simplify "1 - bool_val" to "bool_val ^ 1"

2023-01-31 Thread Richard Biener via Gcc-patches
On Wed, Feb 1, 2023 at 2:30 AM Andrew Pinski via Gcc-patches wrote: > > For bool values, it is easier to deal with > xor 1 rather than having 1 - a. This is because > we are more likely to simplify the xor further in many > cases. > > This is a special case for (MASK - b) where MASK > is a

[PATCH] Simplify "1 - bool_val" to "bool_val ^ 1"

2023-01-31 Thread Andrew Pinski via Gcc-patches
For bool values, it is easier to deal with xor 1 rather than having 1 - a. This is because we are more likely to simplify the xor further in many cases. This is a special case for (MASK - b) where MASK is a powerof2 - 1 and b <= MASK but only for bool ranges ([0,1]) as that is the main case where

[PATCH] Simplify "1 - bool_val" to "bool_val ^ 1"

2023-01-31 Thread Andrew Pinski via Gcc-patches
For bool values, it is easier to deal with xor 1 rather than having 1 - a. This is because we are more likely to simplify the xor further in many cases. This is a special case for (MASK - b) where MASK is a powerof2 - 1 and b <= MASK but only for bool ranges ([0,1]) as that is the main case where