On Sat, Jun 13, 2015 at 12:05:42PM +0200, Marc Glisse wrote:
> They look fine to me.
Thanks!
> >+/* (x & y) + (x ^ y) -> x | y */
>
> This also works if you replace + with | or ^.
Done.
> >+/* (x | y) - (x ^ y) -> x & y */
>
> For symmetry, you probably also want:
> (x | y) - (x & y) -> x ^ y
Done.
> (they both also work with ^ instead of -)
Done (except (x & y) ^ (x | y) -> x ^ y which we already have).
> >+/* (x & y) + (x | y) -> x + y */
>
> Again for symmetry, it seems like this comes with
> x + y - (x | y) -> x & y
> x + y - (x & y) -> x | y
> which seem fine when overflow is undefined or wraps, but not if for instance
> it saturates.
I'll leave this as a follow-up.
Testing a new patch. Thanks again.
Marek