public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] match.pd: Generalize the PR64309 simplifications [PR96669]
@ 2021-01-15 18:38 Jakub Jelinek
  2021-01-15 19:50 ` Richard Biener
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Jelinek @ 2021-01-15 18:38 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

Hi!

The following patch generalizes the PR64309 simplifications, so that instead
of working only with constants 1 and 1 it works with any two power of two
constants, and works also for right shift (in that case it rules out the
first one being negative, as it is arithmetic shift then).

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2021-01-15  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/96669
	* match.pd (((1 << A) & 1) != 0 -> A == 0,
	((1 << A) & 1) == 0 -> A != 0): Generalize for 1s replaced by
	possibly different power of two constants and to right shift too.

	* gcc.dg/tree-ssa/pr96669-1.c: New test.

--- gcc/match.pd.jj	2021-01-15 14:00:21.567135280 +0100
+++ gcc/match.pd	2021-01-15 17:03:49.207071209 +0100
@@ -3117,13 +3117,26 @@ (define_operator_list COND_TERNARY
       (op @0 { build_int_cst (TREE_TYPE (@1), low); })))))))
 
 
-/* ((1 << A) & 1) != 0 -> A == 0
-   ((1 << A) & 1) == 0 -> A != 0 */
+/* Simplify ((C << x) & D) != 0 where C and D are power of two constants,
+   either to false if D is smaller (unsigned comparison) than C, or to
+   x == log2 (D) - log2 (C).  Similarly for right shifts.  */
 (for cmp (ne eq)
      icmp (eq ne)
  (simplify
-  (cmp (bit_and (lshift integer_onep @0) integer_onep) integer_zerop)
-  (icmp @0 { build_zero_cst (TREE_TYPE (@0)); })))
+  (cmp (bit_and (lshift integer_pow2p@1 @0) integer_pow2p@2) integer_zerop)
+   (with { int c1 = wi::clz (wi::to_wide (@1));
+	   int c2 = wi::clz (wi::to_wide (@2)); }
+    (if (c1 < c2)
+     { constant_boolean_node (cmp == NE_EXPR ? false : true, type); }
+     (icmp @0 { build_int_cst (TREE_TYPE (@0), c1 - c2); }))))
+ (simplify
+  (cmp (bit_and (rshift integer_pow2p@1 @0) integer_pow2p@2) integer_zerop)
+   (if (tree_int_cst_sgn (@1) > 0)
+    (with { int c1 = wi::clz (wi::to_wide (@1));
+	    int c2 = wi::clz (wi::to_wide (@2)); }
+     (if (c1 > c2)
+      { constant_boolean_node (cmp == NE_EXPR ? false : true, type); }
+      (icmp @0 { build_int_cst (TREE_TYPE (@0), c2 - c1); }))))))
 
 /* (CST1 << A) == CST2 -> A == ctz (CST2) - ctz (CST1)
    (CST1 << A) != CST2 -> A != ctz (CST2) - ctz (CST1)
--- gcc/testsuite/gcc.dg/tree-ssa/pr96669-1.c.jj	2021-01-15 17:12:11.067414204 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/pr96669-1.c	2021-01-15 17:11:55.486589792 +0100
@@ -0,0 +1,59 @@
+/* PR tree-optimization/96669 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+/* { dg-final { scan-tree-dump "return a == 0;" "original" } } */
+/* { dg-final { scan-tree-dump "return 1;" "original" } } */
+/* { dg-final { scan-tree-dump "return c == 3;" "original" } } */
+/* { dg-final { scan-tree-dump "return d != 1;" "original" } } */
+/* { dg-final { scan-tree-dump "return e != 0;" "original" } } */
+/* { dg-final { scan-tree-dump "return f == 1;" "original" } } */
+/* { dg-final { scan-tree-dump "return 0;" "original" } } */
+/* { dg-final { scan-tree-dump "return h != 1;" "original" } } */
+
+int
+f1 (int a)
+{
+  return ((1 << a) & 1) != 0;
+}
+
+int
+f2 (int b)
+{
+  return ((2 << b) & 1) == 0;
+}
+
+int
+f3 (int c)
+{
+  return ((2 << c) & 16) != 0;
+}
+
+int
+f4 (int d)
+{
+  return ((16 << d) & 32) == 0;
+}
+
+int
+f5 (int e)
+{
+  return ((1 >> e) & 1) == 0;
+}
+
+int
+f6 (int f)
+{
+  return ((2 >> f) & 1) != 0;
+}
+
+int
+f7 (int g)
+{
+  return ((1 >> g) & 2) != 0;
+}
+
+int
+f8 (int h)
+{
+  return ((32 >> h) & 16) == 0;
+}

	Jakub


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] match.pd: Generalize the PR64309 simplifications [PR96669]
  2021-01-15 18:38 [PATCH] match.pd: Generalize the PR64309 simplifications [PR96669] Jakub Jelinek
@ 2021-01-15 19:50 ` Richard Biener
  2021-01-15 20:03   ` Jakub Jelinek
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Biener @ 2021-01-15 19:50 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On January 15, 2021 7:38:35 PM GMT+01:00, Jakub Jelinek <jakub@redhat.com> wrote:
>Hi!
>
>The following patch generalizes the PR64309 simplifications, so that
>instead
>of working only with constants 1 and 1 it works with any two power of
>two
>constants, and works also for right shift (in that case it rules out
>the
>first one being negative, as it is arithmetic shift then).
>
>Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Ok. 

Richard. 

>2021-01-15  Jakub Jelinek  <jakub@redhat.com>
>
>	PR tree-optimization/96669
>	* match.pd (((1 << A) & 1) != 0 -> A == 0,
>	((1 << A) & 1) == 0 -> A != 0): Generalize for 1s replaced by
>	possibly different power of two constants and to right shift too.
>
>	* gcc.dg/tree-ssa/pr96669-1.c: New test.
>
>--- gcc/match.pd.jj	2021-01-15 14:00:21.567135280 +0100
>+++ gcc/match.pd	2021-01-15 17:03:49.207071209 +0100
>@@ -3117,13 +3117,26 @@ (define_operator_list COND_TERNARY
>       (op @0 { build_int_cst (TREE_TYPE (@1), low); })))))))
> 
> 
>-/* ((1 << A) & 1) != 0 -> A == 0
>-   ((1 << A) & 1) == 0 -> A != 0 */
>+/* Simplify ((C << x) & D) != 0 where C and D are power of two
>constants,
>+   either to false if D is smaller (unsigned comparison) than C, or to
>+   x == log2 (D) - log2 (C).  Similarly for right shifts.  */
> (for cmp (ne eq)
>      icmp (eq ne)
>  (simplify
>-  (cmp (bit_and (lshift integer_onep @0) integer_onep) integer_zerop)
>-  (icmp @0 { build_zero_cst (TREE_TYPE (@0)); })))
>+  (cmp (bit_and (lshift integer_pow2p@1 @0) integer_pow2p@2)
>integer_zerop)
>+   (with { int c1 = wi::clz (wi::to_wide (@1));
>+	   int c2 = wi::clz (wi::to_wide (@2)); }
>+    (if (c1 < c2)
>+     { constant_boolean_node (cmp == NE_EXPR ? false : true, type); }
>+     (icmp @0 { build_int_cst (TREE_TYPE (@0), c1 - c2); }))))
>+ (simplify
>+  (cmp (bit_and (rshift integer_pow2p@1 @0) integer_pow2p@2)
>integer_zerop)
>+   (if (tree_int_cst_sgn (@1) > 0)
>+    (with { int c1 = wi::clz (wi::to_wide (@1));
>+	    int c2 = wi::clz (wi::to_wide (@2)); }
>+     (if (c1 > c2)
>+      { constant_boolean_node (cmp == NE_EXPR ? false : true, type); }
>+      (icmp @0 { build_int_cst (TREE_TYPE (@0), c2 - c1); }))))))
> 
> /* (CST1 << A) == CST2 -> A == ctz (CST2) - ctz (CST1)
>    (CST1 << A) != CST2 -> A != ctz (CST2) - ctz (CST1)
>--- gcc/testsuite/gcc.dg/tree-ssa/pr96669-1.c.jj	2021-01-15
>17:12:11.067414204 +0100
>+++ gcc/testsuite/gcc.dg/tree-ssa/pr96669-1.c	2021-01-15
>17:11:55.486589792 +0100
>@@ -0,0 +1,59 @@
>+/* PR tree-optimization/96669 */
>+/* { dg-do compile } */
>+/* { dg-options "-O2 -fdump-tree-original" } */
>+/* { dg-final { scan-tree-dump "return a == 0;" "original" } } */
>+/* { dg-final { scan-tree-dump "return 1;" "original" } } */
>+/* { dg-final { scan-tree-dump "return c == 3;" "original" } } */
>+/* { dg-final { scan-tree-dump "return d != 1;" "original" } } */
>+/* { dg-final { scan-tree-dump "return e != 0;" "original" } } */
>+/* { dg-final { scan-tree-dump "return f == 1;" "original" } } */
>+/* { dg-final { scan-tree-dump "return 0;" "original" } } */
>+/* { dg-final { scan-tree-dump "return h != 1;" "original" } } */
>+
>+int
>+f1 (int a)
>+{
>+  return ((1 << a) & 1) != 0;
>+}
>+
>+int
>+f2 (int b)
>+{
>+  return ((2 << b) & 1) == 0;
>+}
>+
>+int
>+f3 (int c)
>+{
>+  return ((2 << c) & 16) != 0;
>+}
>+
>+int
>+f4 (int d)
>+{
>+  return ((16 << d) & 32) == 0;
>+}
>+
>+int
>+f5 (int e)
>+{
>+  return ((1 >> e) & 1) == 0;
>+}
>+
>+int
>+f6 (int f)
>+{
>+  return ((2 >> f) & 1) != 0;
>+}
>+
>+int
>+f7 (int g)
>+{
>+  return ((1 >> g) & 2) != 0;
>+}
>+
>+int
>+f8 (int h)
>+{
>+  return ((32 >> h) & 16) == 0;
>+}
>
>	Jakub


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] match.pd: Generalize the PR64309 simplifications [PR96669]
  2021-01-15 19:50 ` Richard Biener
@ 2021-01-15 20:03   ` Jakub Jelinek
  2021-01-15 20:21     ` Richard Biener
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Jelinek @ 2021-01-15 20:03 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Fri, Jan 15, 2021 at 08:50:20PM +0100, Richard Biener wrote:
> On January 15, 2021 7:38:35 PM GMT+01:00, Jakub Jelinek <jakub@redhat.com> wrote:
> >Hi!
> >
> >The following patch generalizes the PR64309 simplifications, so that
> >instead
> >of working only with constants 1 and 1 it works with any two power of
> >two
> >constants, and works also for right shift (in that case it rules out
> >the
> >first one being negative, as it is arithmetic shift then).
> >
> >Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> Ok. 

Thanks.

BTW, I've tried to also fix what the PR wanted primarily by adding
/* Simplify (CST << x) & 1 to 0 if CST is even or to x == 0 if it is odd.  /
(simplify
 (bit_and (lshift INTEGER_CST@1 @0) integer_onep)
  (if ((wi::to_wide (@1) & 1) != 0)
   (eq @0 { build_zero_cst (TREE_TYPE (@0)); })
   ({ build_zero_cst (type); })))
simplifier before this one, but genmatch.c doesn't seem to put it into the
resulting files.  Is there a way to figure out what is going on?

I remember you said one can't have multiple too similar rules,
but the closest one I can find is
(for shift (lshift rshift)
 (simplify
  (bit_and (convert?:s@4 (shift:s@5 (convert1?@3 @0) INTEGER_CST@1))
           INTEGER_CST@2)
Is it that one that makes the above not work and shall I then
stick it into the same simplifier?
What I want has the @1 in this one actually not an INTEGER_CST, while @3
shall be INTEGER_CST...

	Jakub


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] match.pd: Generalize the PR64309 simplifications [PR96669]
  2021-01-15 20:03   ` Jakub Jelinek
@ 2021-01-15 20:21     ` Richard Biener
  2021-01-16  0:59       ` [PATCH] match.pd: Optimize ((cst << x) & 1) [PR96669] Jakub Jelinek
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Biener @ 2021-01-15 20:21 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On January 15, 2021 9:03:58 PM GMT+01:00, Jakub Jelinek <jakub@redhat.com> wrote:
>On Fri, Jan 15, 2021 at 08:50:20PM +0100, Richard Biener wrote:
>> On January 15, 2021 7:38:35 PM GMT+01:00, Jakub Jelinek
><jakub@redhat.com> wrote:
>> >Hi!
>> >
>> >The following patch generalizes the PR64309 simplifications, so that
>> >instead
>> >of working only with constants 1 and 1 it works with any two power
>of
>> >two
>> >constants, and works also for right shift (in that case it rules out
>> >the
>> >first one being negative, as it is arithmetic shift then).
>> >
>> >Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>> 
>> Ok. 
>
>Thanks.
>
>BTW, I've tried to also fix what the PR wanted primarily by adding
>/* Simplify (CST << x) & 1 to 0 if CST is even or to x == 0 if it is
>odd.  /
>(simplify
> (bit_and (lshift INTEGER_CST@1 @0) integer_onep)
>  (if ((wi::to_wide (@1) & 1) != 0)
>   (eq @0 { build_zero_cst (TREE_TYPE (@0)); })
>   ({ build_zero_cst (type); })))
>simplifier before this one, but genmatch.c doesn't seem to put it into
>the
>resulting files.  Is there a way to figure out what is going on?
>
>I remember you said one can't have multiple too similar rules,
>but the closest one I can find is
>(for shift (lshift rshift)
> (simplify
>  (bit_and (convert?:s@4 (shift:s@5 (convert1?@3 @0) INTEGER_CST@1))
>           INTEGER_CST@2)
>Is it that one that makes the above not work and shall I then
>stick it into the same simplifier?

Hmm, genmatch should warn then (maybe only with -v). But yeah, it looks awfully close (though INTEGER_CST vs. Integer_onep should make a difference... 

You could try Debug genmatch with a smaller file containing just the two cases. The intent is to diagnose 'dropped' patterns. 

>What I want has the @1 in this one actually not an INTEGER_CST, while
>@3
>shall be INTEGER_CST...
>
>	Jakub


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] match.pd: Optimize ((cst << x) & 1) [PR96669]
  2021-01-15 20:21     ` Richard Biener
@ 2021-01-16  0:59       ` Jakub Jelinek
  2021-01-16  7:49         ` Richard Biener
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Jelinek @ 2021-01-16  0:59 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Fri, Jan 15, 2021 at 09:21:07PM +0100, Richard Biener wrote:
> >BTW, I've tried to also fix what the PR wanted primarily by adding
> >/* Simplify (CST << x) & 1 to 0 if CST is even or to x == 0 if it is
> >odd.  /
> >(simplify
> > (bit_and (lshift INTEGER_CST@1 @0) integer_onep)
> >  (if ((wi::to_wide (@1) & 1) != 0)
> >   (eq @0 { build_zero_cst (TREE_TYPE (@0)); })
> >   ({ build_zero_cst (type); })))
> >simplifier before this one, but genmatch.c doesn't seem to put it into
> >the
> >resulting files.  Is there a way to figure out what is going on?

Actually, it was a PEBKAC, it helps when the comment termination is */
rather than just / alone.

The following works fine, no need to stick it into an unrelated pattern.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2021-01-15  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/96669
	* match.pd ((CST << x) & 1 -> x == 0): New simplification.

	* gcc.dg/tree-ssa/pr96669-1.c: Adjust regexp.
	* gcc.dg/tree-ssa/pr96669-2.c: New test.

--- gcc/match.pd.jj	2021-01-15 21:12:07.656060308 +0100
+++ gcc/match.pd	2021-01-15 23:51:34.038119715 +0100
@@ -3117,6 +3117,13 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
       (op @0 { build_int_cst (TREE_TYPE (@1), low); })))))))
 
 
+/* Simplify (CST << x) & 1 to 0 if CST is even or to x == 0 if it is odd.  */
+(simplify
+ (bit_and (lshift INTEGER_CST@1 @0) integer_onep)
+  (if ((wi::to_wide (@1) & 1) != 0)
+   (convert (eq:boolean_type_node @0 { build_zero_cst (TREE_TYPE (@0)); }))
+   { build_zero_cst (type); }))
+
 /* Simplify ((C << x) & D) != 0 where C and D are power of two constants,
    either to false if D is smaller (unsigned comparison) than C, or to
    x == log2 (D) - log2 (C).  Similarly for right shifts.  */
--- gcc/testsuite/gcc.dg/tree-ssa/pr96669-1.c.jj	2021-01-15 22:03:18.089279035 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/pr96669-1.c	2021-01-16 01:55:42.800379400 +0100
@@ -1,7 +1,7 @@
 /* PR tree-optimization/96669 */
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-original" } */
-/* { dg-final { scan-tree-dump "return a == 0;" "original" } } */
+/* { dg-final { scan-tree-dump "a == 0" "original" } } */
 /* { dg-final { scan-tree-dump "return 1;" "original" } } */
 /* { dg-final { scan-tree-dump "return c == 3;" "original" } } */
 /* { dg-final { scan-tree-dump "return d != 1;" "original" } } */
--- gcc/testsuite/gcc.dg/tree-ssa/pr96669-2.c.jj	2021-01-15 22:03:47.075951818 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/pr96669-2.c	2021-01-16 01:56:02.859156051 +0100
@@ -0,0 +1,30 @@
+/* PR tree-optimization/96669 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+/* { dg-final { scan-tree-dump "a == 0" "original" } } */
+/* { dg-final { scan-tree-dump-times "return 0;" 2 "original" } } */
+/* { dg-final { scan-tree-dump "c == 0" "original" } } */
+
+int
+f1 (int a)
+{
+  return ((1 << a) & 1);
+}
+
+int
+f2 (int b)
+{
+  return ((2 << b) & 1);
+}
+
+int
+f3 (int c)
+{
+  return ((35 << c) & 1);
+}
+
+int
+f4 (int d)
+{
+  return ((42 << d) & 1);
+}


	Jakub


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] match.pd: Optimize ((cst << x) & 1) [PR96669]
  2021-01-16  0:59       ` [PATCH] match.pd: Optimize ((cst << x) & 1) [PR96669] Jakub Jelinek
@ 2021-01-16  7:49         ` Richard Biener
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Biener @ 2021-01-16  7:49 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On January 16, 2021 1:59:50 AM GMT+01:00, Jakub Jelinek <jakub@redhat.com> wrote:
>On Fri, Jan 15, 2021 at 09:21:07PM +0100, Richard Biener wrote:
>> >BTW, I've tried to also fix what the PR wanted primarily by adding
>> >/* Simplify (CST << x) & 1 to 0 if CST is even or to x == 0 if it is
>> >odd.  /
>> >(simplify
>> > (bit_and (lshift INTEGER_CST@1 @0) integer_onep)
>> >  (if ((wi::to_wide (@1) & 1) != 0)
>> >   (eq @0 { build_zero_cst (TREE_TYPE (@0)); })
>> >   ({ build_zero_cst (type); })))
>> >simplifier before this one, but genmatch.c doesn't seem to put it
>into
>> >the
>> >resulting files.  Is there a way to figure out what is going on?
>
>Actually, it was a PEBKAC, it helps when the comment termination is */
>rather than just / alone.
>
>The following works fine, no need to stick it into an unrelated
>pattern.
>
>Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Ok. 

Richard. 

>2021-01-15  Jakub Jelinek  <jakub@redhat.com>
>
>	PR tree-optimization/96669
>	* match.pd ((CST << x) & 1 -> x == 0): New simplification.
>
>	* gcc.dg/tree-ssa/pr96669-1.c: Adjust regexp.
>	* gcc.dg/tree-ssa/pr96669-2.c: New test.
>
>--- gcc/match.pd.jj	2021-01-15 21:12:07.656060308 +0100
>+++ gcc/match.pd	2021-01-15 23:51:34.038119715 +0100
>@@ -3117,6 +3117,13 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
>       (op @0 { build_int_cst (TREE_TYPE (@1), low); })))))))
> 
> 
>+/* Simplify (CST << x) & 1 to 0 if CST is even or to x == 0 if it is
>odd.  */
>+(simplify
>+ (bit_and (lshift INTEGER_CST@1 @0) integer_onep)
>+  (if ((wi::to_wide (@1) & 1) != 0)
>+   (convert (eq:boolean_type_node @0 { build_zero_cst (TREE_TYPE
>(@0)); }))
>+   { build_zero_cst (type); }))
>+
>/* Simplify ((C << x) & D) != 0 where C and D are power of two
>constants,
>    either to false if D is smaller (unsigned comparison) than C, or to
>    x == log2 (D) - log2 (C).  Similarly for right shifts.  */
>--- gcc/testsuite/gcc.dg/tree-ssa/pr96669-1.c.jj	2021-01-15
>22:03:18.089279035 +0100
>+++ gcc/testsuite/gcc.dg/tree-ssa/pr96669-1.c	2021-01-16
>01:55:42.800379400 +0100
>@@ -1,7 +1,7 @@
> /* PR tree-optimization/96669 */
> /* { dg-do compile } */
> /* { dg-options "-O2 -fdump-tree-original" } */
>-/* { dg-final { scan-tree-dump "return a == 0;" "original" } } */
>+/* { dg-final { scan-tree-dump "a == 0" "original" } } */
> /* { dg-final { scan-tree-dump "return 1;" "original" } } */
> /* { dg-final { scan-tree-dump "return c == 3;" "original" } } */
> /* { dg-final { scan-tree-dump "return d != 1;" "original" } } */
>--- gcc/testsuite/gcc.dg/tree-ssa/pr96669-2.c.jj	2021-01-15
>22:03:47.075951818 +0100
>+++ gcc/testsuite/gcc.dg/tree-ssa/pr96669-2.c	2021-01-16
>01:56:02.859156051 +0100
>@@ -0,0 +1,30 @@
>+/* PR tree-optimization/96669 */
>+/* { dg-do compile } */
>+/* { dg-options "-O2 -fdump-tree-original" } */
>+/* { dg-final { scan-tree-dump "a == 0" "original" } } */
>+/* { dg-final { scan-tree-dump-times "return 0;" 2 "original" } } */
>+/* { dg-final { scan-tree-dump "c == 0" "original" } } */
>+
>+int
>+f1 (int a)
>+{
>+  return ((1 << a) & 1);
>+}
>+
>+int
>+f2 (int b)
>+{
>+  return ((2 << b) & 1);
>+}
>+
>+int
>+f3 (int c)
>+{
>+  return ((35 << c) & 1);
>+}
>+
>+int
>+f4 (int d)
>+{
>+  return ((42 << d) & 1);
>+}
>
>
>	Jakub


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-16  7:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 18:38 [PATCH] match.pd: Generalize the PR64309 simplifications [PR96669] Jakub Jelinek
2021-01-15 19:50 ` Richard Biener
2021-01-15 20:03   ` Jakub Jelinek
2021-01-15 20:21     ` Richard Biener
2021-01-16  0:59       ` [PATCH] match.pd: Optimize ((cst << x) & 1) [PR96669] Jakub Jelinek
2021-01-16  7:49         ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).