Addressing is slow

Addressing is slow

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

3 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

>>...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.

Connectez-vous pour laisser un commentaire.