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

--- Comment #9 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 
2011-03-14 10:08:29 UTC ---
It is interesting to note that in case of fixed size (such as in these trivial
or template examples)
vectorization works also for unsigned int

void loop10( double const * __restrict__ x_in,  double * __restrict__ x_out,
double const * __restrict__ c) {
   for(unsigned int i=0; i!=10; ++i)
       x_out[i] = c[i]*x_in[i];
}


template<typename T, unsigned int N>
void loopTu( T const * __restrict__ x_in,  T * __restrict__ x_out, T const *
__restrict__ c) {
   for(unsigned int i=0; i!=N; ++i)
       x_out[i] = c[i]*x_in[i];
}

template<typename T, unsigned long long N>
void loopTull( T const * __restrict__ x_in,  T * __restrict__ x_out, T const *
__restrict__ c) {
   for(unsigned long long i=0; i!=N; ++i)
       x_out[i] = c[i]*x_in[i];
}


void go(double const * __restrict__ x_in,  double * __restrict__ x_out, double
const * __restrict__ c) {

  loopTu<double,10>(x_in, x_out, c);

  loopTull<double,10>(x_in, x_out, c);

}

Reply via email to