Addressing is slow

Addressing is slow

Imagen de 唐黎 唐.

Hi,

I am using AVX and want to mplement a simple serial search. My code is like the following:

    __m256 cmp = _mm256_load_ps(array);
    __m256 keys = _mm256_broadcast_ss(key);
    __m256 res= _mm256_cmp_ps(keys, cmp, 0);
    int tmp =  _mm256_movemask_ps(res);
    switch (tmp) {
      case 0: ind = 0;
      case 1: ind = 1;
      case 2: ind = 2;
      case 4: ind = 3;
      case 8: ind = 4;
      ......
    }

I also tried lookup table, but they are both very slow. Any ideas to improve it? Thanks

publicaciones de 3 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de styc
Imagen de Sergey Kostrov

>>...I also tried lookup table, but they are both very slow. Any ideas to improve it?

I recommend you to look at a latest version of Intel Optimization Manual ( 04.2012 ) at:

www.intel.com/content/www/us/en/processors/architectures-software-develo...

The Manual has a new chapter dedicated to string processing.

Inicie sesión para dejar un comentario.