This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/54716] New: Select best typed instruction for bitwise operations


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]