On Tue, 18 Jul 2017, Jakub Jelinek wrote:
> Hi!
>
> The following patch implements the:
> /* Optimize (c>=1) && (c<=127) into (signed char)c > 0. */
> if (integer_onep (low) && TREE_CODE (high) == INTEGER_CST)
> {
> int prec = TYPE_PRECISION (etype);
>
> if (wi::mask (prec
On Tue, 18 Jul 2017, Jakub Jelinek wrote:
> On Tue, Jul 18, 2017 at 10:47:37AM -0600, Martin Sebor wrote:
> > On 07/18/2017 09:43 AM, Jakub Jelinek wrote:
> > > On Tue, Jul 18, 2017 at 09:31:11AM -0600, Martin Sebor wrote:
> > > > > --- gcc/match.pd.jj 2017-07-17 16:25:20.0 +0200
> > >
On Tue, Jul 18, 2017 at 10:47:37AM -0600, Martin Sebor wrote:
> On 07/18/2017 09:43 AM, Jakub Jelinek wrote:
> > On Tue, Jul 18, 2017 at 09:31:11AM -0600, Martin Sebor wrote:
> > > > --- gcc/match.pd.jj 2017-07-17 16:25:20.0 +0200
> > > > +++ gcc/match.pd2017-07-18
On 07/18/2017 09:43 AM, Jakub Jelinek wrote:
On Tue, Jul 18, 2017 at 09:31:11AM -0600, Martin Sebor wrote:
--- gcc/match.pd.jj 2017-07-17 16:25:20.0 +0200
+++ gcc/match.pd2017-07-18 12:32:52.896924558 +0200
@@ -1125,6 +1125,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
On Tue, 18 Jul 2017, Jakub Jelinek wrote:
On Tue, Jul 18, 2017 at 05:35:54PM +0200, Marc Glisse wrote:
On Tue, 18 Jul 2017, Jakub Jelinek wrote:
In the PR Marc noted that the optimization might be useful even for
constants other than 1, by transforming
x+C1 <= C2 if unsigned and
On Tue, Jul 18, 2017 at 05:35:54PM +0200, Marc Glisse wrote:
> On Tue, 18 Jul 2017, Jakub Jelinek wrote:
>
> > In the PR Marc noted that the optimization might be useful even for
> > constants other than 1, by transforming
> > x+C1 <= C2 if unsigned and C2-C1==INT_MAX into (int)x > (int)(-1-C1).
On Tue, Jul 18, 2017 at 09:31:11AM -0600, Martin Sebor wrote:
> > --- gcc/match.pd.jj 2017-07-17 16:25:20.0 +0200
> > +++ gcc/match.pd2017-07-18 12:32:52.896924558 +0200
> > @@ -1125,6 +1125,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
> > && wi::neg_p (@1, TYPE_SIGN (TREE_TYPE
On Tue, 18 Jul 2017, Jakub Jelinek wrote:
In the PR Marc noted that the optimization might be useful even for
constants other than 1, by transforming
x+C1 <= C2 if unsigned and C2-C1==INT_MAX into (int)x > (int)(-1-C1).
(int)x >= (int)(-C1) might be easier (and more valid, except that the
--- gcc/match.pd.jj 2017-07-17 16:25:20.0 +0200
+++ gcc/match.pd2017-07-18 12:32:52.896924558 +0200
@@ -1125,6 +1125,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
&& wi::neg_p (@1, TYPE_SIGN (TREE_TYPE (@1
(cmp @2 @0))
+/* (X - 1U) <= INT_MAX-1U into (int) X
Hi!
The following patch implements the:
/* Optimize (c>=1) && (c<=127) into (signed char)c > 0. */
if (integer_onep (low) && TREE_CODE (high) == INTEGER_CST)
{
int prec = TYPE_PRECISION (etype);
if (wi::mask (prec - 1, false, prec) == high)
{
if
10 matches
Mail list logo