This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix PR tree-optimization/46213


Hi,

On Thu, 4 Nov 2010, Dominique Dhumieres wrote:

> Why not unrolling it as res = res + a[i+1]-a[i] (staring with the right 
> sign!-)?

Of course, that's one possibility.  It's just not too trivial to 
implement, you have to check that a[i+1] is available in iteration i (i+1 
in bounds and a[i+1] not changed after access), i.e. one more unobvious 
data dependence check, and of course the above isn't gimple.

It would most probably be easier to emit vectorize "res = Xi - res" simply 
as "res = Xi + res", relying that the vectorize factor is even, and then, 
during post-processing the VF streams first multiply vres by {1, -1, 1, -1} 
(in face of VF == 4 and starting with minus) before horizontal add.


Ciao,
Michael.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]