public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104371] New: [x86] Failure to use optimize pxor+pcmpeqb+pmovmskb+cmp 0xFFFF pattern to ptest
@ 2022-02-03 18:08 gabravier at gmail dot com
  2022-02-03 23:07 ` [Bug target/104371] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gabravier at gmail dot com @ 2022-02-03 18:08 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-07-28 18:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-03 18:08 [Bug target/104371] New: [x86] Failure to use optimize pxor+pcmpeqb+pmovmskb+cmp 0xFFFF pattern to ptest gabravier at gmail dot com
2022-02-03 23:07 ` [Bug target/104371] " pinskia at gcc dot gnu.org
2022-02-04  8:03 ` rguenth at gcc dot gnu.org
2022-02-04 19:21 ` gabravier at gmail dot com
2022-02-07  5:12 ` crazylht at gmail dot com
2022-02-07  5:16 ` crazylht at gmail dot com
2022-02-07  5:41 ` crazylht at gmail dot com
2022-03-31  6:13 ` haochen.jiang at intel dot com
2022-05-12  9:37 ` cvs-commit at gcc dot gnu.org
2022-05-12  9:45 ` haochen.jiang at intel dot com
2022-07-28 18:54 ` hjl.tools at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).