This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/54716] New: Select best typed instruction for bitwise operations
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 26 Sep 2012 12:37:29 +0000
- Subject: [Bug target/54716] New: Select best typed instruction for bitwise operations
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: glisse@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.