https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95754
Bug ID: 95754
Summary: Failure to optimize __builtin_ia32_cmpb512_mask with
anded first operand, 0 second operand and neq
operation
Product: gcc
Version: 11.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 char v64i8 __attribute__((vector_size(64)));
int64_t f(v64i8 a, v64i8 b)
{
return __builtin_ia32_cmpb512_mask((a & b), (v64i8){0}, 4, -1);
}
This can be optimized to _mm512_test_epi8_mask(a, b). This transformation is
done by LLVM, but not by GCC.