http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54716
Bug #: 54716 Summary: Select best typed instruction for bitwise operations 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 Hello, consider these 3 versions of OR: #include <x86intrin.h> __m256d f(__m256d x,__m256d y){ return (__m256d)((__m256i)x|(__m256i)y); } __m256d g(__m256d x,__m256d y){ return _mm256_or_pd(x,y); } __m256i h(__m256i x,__m256i y){ return x|y; } With -mavx, they compile to vorps, vorpd, vorps. With -mavx2, they compile to vpor, vorpd, vpor. Functions g and h are fine, but for f (which is about the only way to write OR using the C vector extensions, since | doesn't apply to floats) it would be great to see vorpd in both cases.