This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/41881] Complete unrolling (inner) versus vectorization of reduction



------- Comment #1 from rguenth at gcc dot gnu dot org  2009-10-30 22:20 -------
You could use -O2 -ftree-vectorize.

Another pretty straight-forward way to write the operation is

TYPE fun3(TYPE *x, TYPE *y, unsigned int n)
{
  int i, j;
  TYPE dot = 0;

  for (i = 0; i < n / 8; i++)
    {
      dot += *(x++) * *(y++);
      dot += *(x++) * *(y++);
      dot += *(x++) * *(y++);
      dot += *(x++) * *(y++);
      dot += *(x++) * *(y++);
      dot += *(x++) * *(y++);
      dot += *(x++) * *(y++);
      dot += *(x++) * *(y++);
    }

  return dot;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41881


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