On Tue, Jun 23, 2015 at 10:22:35AM +0200, Richard Biener wrote:
> Who says you can't do bitwise ops on them? I can't see that being
> enforced in the GIMPLE checking in tree-cfg.c. Yes, there is no
> such thing as a "saturating" bitwise and but bitwise and should
> just work fine.
>
> You can ch
On Tue, 23 Jun 2015, Marek Polacek wrote:
> On Tue, Jun 23, 2015 at 09:56:33AM +0200, Richard Biener wrote:
> > > I think you're right about TYPE_SATURATING so I've dropped that and
> > > instead
> > > replaced it with TYPE_OVERFLOW_TRAPS. That should do the right thing
> > > together with TYPE_
On Tue, Jun 23, 2015 at 09:56:33AM +0200, Richard Biener wrote:
> > I think you're right about TYPE_SATURATING so I've dropped that and instead
> > replaced it with TYPE_OVERFLOW_TRAPS. That should do the right thing
> > together with TYPE_OVERFLOW_SANITIZED.
>
> Are you sure? The point is that
On Mon, 22 Jun 2015, Marek Polacek wrote:
> On Fri, Jun 19, 2015 at 05:51:53PM +0200, Marc Glisse wrote:
> > On Fri, 19 Jun 2015, Marek Polacek wrote:
> >
> > >+/* x + y - (x | y) -> x & y */
> > >+(simplify
> > >+ (minus (plus @0 @1) (bit_ior @0 @1))
> > >+ (if (!TYPE_OVERFLOW_SANITIZED (type) &
On Fri, Jun 19, 2015 at 05:51:53PM +0200, Marc Glisse wrote:
> On Fri, 19 Jun 2015, Marek Polacek wrote:
>
> >+/* x + y - (x | y) -> x & y */
> >+(simplify
> >+ (minus (plus @0 @1) (bit_ior @0 @1))
> >+ (if (!TYPE_OVERFLOW_SANITIZED (type) && !TYPE_SATURATING (type))
> >+ (bit_and @0 @1)))
> >+
>
On Fri, 19 Jun 2015, Marek Polacek wrote:
> On Thu, Jun 18, 2015 at 05:41:18PM +0200, Marek Polacek wrote:
> > > 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
On Thu, 18 Jun 2015, Marek Polacek wrote:
> On Tue, Jun 16, 2015 at 03:35:15PM +0200, Richard Biener wrote:
> > We already have
> >
> > /* (x & y) ^ (x | y) -> x ^ y */
> > (simplify
> > (bit_xor:c (bit_and @0 @1) (bit_ior @0 @1))
> > (bit_xor @0 @1))
> >
> > but of course with minus it doesn'
On Fri, 19 Jun 2015, Marek Polacek wrote:
+/* x + y - (x | y) -> x & y */
+(simplify
+ (minus (plus @0 @1) (bit_ior @0 @1))
+ (if (!TYPE_OVERFLOW_SANITIZED (type) && !TYPE_SATURATING (type))
+ (bit_and @0 @1)))
+
+/* (x + y) - (x & y) -> x | y */
+(simplify
+ (minus (plus @0 @1) (bit_and @0 @1)
On Thu, Jun 18, 2015 at 05:41:18PM +0200, Marek Polacek wrote:
> > 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
On Tue, Jun 16, 2015 at 03:35:15PM +0200, Richard Biener wrote:
> We already have
>
> /* (x & y) ^ (x | y) -> x ^ y */
> (simplify
> (bit_xor:c (bit_and @0 @1) (bit_ior @0 @1))
> (bit_xor @0 @1))
>
> but of course with minus it doesn't commutate so it's hard to
> merge.
Yeah :(.
> > > +/* (x
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 ^
On Sat, 13 Jun 2015, Marc Glisse wrote:
> They look fine to me.
>
> > +/* (x & y) + (x ^ y) -> x | y */
>
> This also works if you replace + with | or ^.
>
> > +/* (x | y) - (x ^ y) -> x & y */
>
> For symmetry, you probably also want:
> (x | y) - (x & y) -> x ^ y
>
> (they both also work with
They look fine to me.
+/* (x & y) + (x ^ y) -> x | y */
This also works if you replace + with | or ^.
+/* (x | y) - (x ^ y) -> x & y */
For symmetry, you probably also want:
(x | y) - (x & y) -> x ^ y
(they both also work with ^ instead of -)
+/* (x & y) + (x | y) -> x + y */
Again fo
This patch brings three new patterns for match.pd. I think these are
rare, but it shouldn't hurt to have them.
(I suppose you'd be happier if I was moving patterns from fold-const to
match.pd. I'll work on that as well.)
Given previous discussion, I don't think there's much to say otherwise,
but
14 matches
Mail list logo