MetaScale/nt2 — pull request #772 by khegeman (2014-07-01 00:35:14+00:00)
Title: use avx blend for cardinality 4 shuffles with pattern (0 or 4,1 or 5,2 o...

this pull request adds a specialization for cardinality 4 avx shuffles that match the pattern \<0 or 4, 1 or 5, 2 or 6,3 or 7\>

simple example
``` cpp
#include
#include
using boost::simd::pack;
using boost::simd::shuffle;
typedef pack pack_t;

pack_t shuf(pack_t a, pack_t b) {
return shuffle<0,1,2,7>(a,b);
}
int main(int argc, char *argv[])
{
pack_t a(0,1,2,3);
pack_t b(4,5,6,7);
std::cout << shuf(a,b) << std::endl;
return 0;
}
```

```
master branch with
g++-4.8.1 -O3 -S -mavx

```
.cfi_startproc
vextractf128 $0x1, %ymm1, %xmm1
vextractf128 $0x1, %ymm0, %xmm2
vunpckhpd %xmm1, %xmm1, %xmm1
vunpcklpd %xmm1, %xmm2, %xmm2
vinsertf128 $0x1, %xmm2, %ymm0, %ymm0
ret
.cfi_endproc
```

This patch

```
.cfi_startproc
vblendpd $8, %ymm1, %ymm0, %ymm0
ret
.cfi_endproc
```