Re: [patch] Another enhancement of widen-mult in the vectorizer

2011-06-16 Thread Ira Rosen
>> >> +         && TREE_CODE (half_type1) == INTEGER_TYPE) >> +       { >> +         if (int_fits_type_p (oprnd0, half_type1)) >> >> I believe you need to check that oprnd0 is a INTEGER_CST before calling >> int_fits_type_p. >> >> +            { >> +             /* OPRND0 is a constant of HALF_TYPE

Re: [patch] Another enhancement of widen-mult in the vectorizer

2011-06-16 Thread Richard Guenther
On Thu, Jun 16, 2011 at 10:00 AM, Richard Guenther wrote: > On Thu, Jun 16, 2011 at 8:54 AM, Ira Rosen wrote: >> Hi, >> >> For >> >> unsigned char in[N]; >> int out[N]; >> for (i = 0; i < N; i++) >>    out[i] = in[i] * 300; >> >> in[i] is first promoted to int and then multiplied by 300. This >>

Re: [patch] Another enhancement of widen-mult in the vectorizer

2011-06-16 Thread Richard Guenther
On Thu, Jun 16, 2011 at 8:54 AM, Ira Rosen wrote: > Hi, > > For > > unsigned char in[N]; > int out[N]; > for (i = 0; i < N; i++) >    out[i] = in[i] * 300; > > in[i] is first promoted to int and then multiplied by 300. This > over-promotion prevents the vectorizer from using the widen-mult > patte

[patch] Another enhancement of widen-mult in the vectorizer

2011-06-15 Thread Ira Rosen
Hi, For unsigned char in[N]; int out[N]; for (i = 0; i < N; i++) out[i] = in[i] * 300; in[i] is first promoted to int and then multiplied by 300. This over-promotion prevents the vectorizer from using the widen-mult pattern here. This patch checks if a constant fits an intermediate type (sh