http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54531
Bug #: 54531 Summary: vpermilpd(x, 2 or 10) is a move Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassig...@gcc.gnu.org ReportedBy: gli...@gcc.gnu.org Target: x86_64-linux-gnu Hello, it is quite easy to make gcc generate instructions that are equivalent to moves, but gcc doesn't realize that. Simple examples include _mm256_permute_pd(x,10) and _mm_permute_pd(x,2), but I also got it while trying a patch that generated some vec_selects. I believe those instructions should be optimized out. #include <x86intrin.h> __m256d f(__m256d x){ return _mm256_permute_pd(x,2+8); } gcc -O3 -S -mavx (with -mavx2 we get vpermpd(x,228) which is a similar issue)