http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48870

           Summary: operator== overload of vector types
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: john.sal...@deshaw.com


I'd like to overload operator== for vector (e.g., SSE __m128i) types.  It seems
that __m128i is neither of class nor enumerated types, which makes it
unsuitable for operator-overload.  Can this be fixed?

salm...@drdlogin0039.en.desres$ cat m128.cpp
#include <x86intrin.h>

bool operator==(__m128i a, __m128i b){
    __m128i x = _mm_xor_si128(a, b);
    return _mm_testz_si128(x, x);
}

salm...@drdlogin0039.en.desres$ dw -m gcc/4.6.0-23A/bin g++ -msse4.2 m128.cpp
m128.cpp:3:37: error: 'bool operator==(__m128i, __m128i)' must have an argument
of class or enumerated type
salm...@drdlogin0039.en.desres$

Reply via email to