https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94871
Bug ID: 94871
Summary: Failure to convert cmpeqpd+pxor with -1 into cmpneqpd
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: gabravier at gmail dot com
Target Milestone: ---
typedef double v2df __attribute__((vector_size(16)));
typedef int64_t v2di __attribute__((vector_size(16)));
typedef int8_t v16qi __attribute__((vector_size(16)));
inline v2di set1_epi8(int8_t a)
{
return (v2di)(v16qi){a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a};
}
v2di cmpneq_pd(v2df a, v2df b)
{
return ((v2di)__builtin_ia32_cmpeqpd(a, b) ^ set1_epi8(0xFF));
}
With -O3, LLVM outputs :
cmpneq_pd(double __vector(2), double __vector(2)):
cmpneqpd xmm0, xmm1
ret
GCC outputs :
cmpneq_pd(double __vector(2), double __vector(2)):
cmpeqpd xmm0, xmm1
pcmpeqd xmm1, xmm1
pxor xmm0, xmm1
ret