[Bug c++/48870] New: operator== overload of vector types

john.salmon at deshaw dot com gcc-bugzilla@gcc.gnu.org
Wed May 4 14:13:00 GMT 2011


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: unassigned@gcc.gnu.org
        ReportedBy: john.salmon@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?

salmonj@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);
}

salmonj@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
salmonj@drdlogin0039.en.desres$



More information about the Gcc-bugs mailing list