[Bug target/104371] New: [x86] Failure to use optimize pxor+pcmpeqb+pmovmskb+cmp 0xFFFF pattern to ptest
gabravier at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Feb 3 18:08:42 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104371
Bug ID: 104371
Summary: [x86] Failure to use optimize
pxor+pcmpeqb+pmovmskb+cmp 0xFFFF pattern to ptest
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: gabravier at gmail dot com
Target Milestone: ---
bool is_zero(__m128i x)
{
return _mm_movemask_epi8(_mm_cmpeq_epi8(x, _mm_setzero_si128())) == 0xffff;
}
This can be optimized to `return _mm_testz_si128(x, x);`. This optimization is
done by LLVM, but not by GCC.
More information about the Gcc-bugs
mailing list