public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/101989] New: Fail to optimize (a & b) | (c & ~b) to vpternlog instruction. Date: Fri, 20 Aug 2021 01:46:13 +0000 [thread overview] Message-ID: <bug-101989-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101989 Bug ID: 101989 Summary: Fail to optimize (a & b) | (c & ~b) to vpternlog instruction. Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: crazylht at gmail dot com Target Milestone: --- Host: x86_64-pc-linux-gnu Target: x86_64-*-* i?86-*-* cat test.c __m128i foo (__m128i src1, __m128i src2, __m128i src3) { return (src2 & ~src1) | (src3 & src1); } __m128i foo1 (__m128i src1, __m128i src2, __m128i src3) { return (src2 & src1) | (src3 & ~src1); } gcc -O2 -march=cascadelake generates foo(long long __vector(2), long long __vector(2), long long __vector(2)): vpxor %xmm2, %xmm1, %xmm2 vpand %xmm0, %xmm2, %xmm2 vpxor %xmm1, %xmm2, %xmm0 ret foo1(long long __vector(2), long long __vector(2), long long __vector(2)): vpxor %xmm2, %xmm1, %xmm1 vpand %xmm0, %xmm1, %xmm1 vpxor %xmm2, %xmm1, %xmm0 ret icx generates foo(long long __vector(2), long long __vector(2), long long __vector(2)): # vpternlogq xmm0, xmm2, xmm1, 202 ret foo1(long long __vector(2), long long __vector(2), long long __vector(2)): # vpternlogq xmm0, xmm1, xmm2, 202 ret Guess we need a post_reload splitter to match Failed to match this instruction: (set (reg:V2DI 88) (xor:V2DI (and:V2DI (xor:V2DI (reg:V2DI 92) (reg/v:V2DI 87 [ src3 ])) (reg:V2DI 91)) (reg/v:V2DI 87 [ src3 ]))) Failed to match this instruction:
next reply other threads:[~2021-08-20 1:46 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-20 1:46 crazylht at gmail dot com [this message] 2021-08-20 1:50 ` [Bug target/101989] " crazylht at gmail dot com 2021-08-20 2:00 ` pinskia at gcc dot gnu.org 2021-08-24 9:45 ` cvs-commit at gcc dot gnu.org 2021-08-24 10:34 ` cvs-commit at gcc dot gnu.org 2021-08-24 10:35 ` crazylht at gmail dot com 2021-08-25 1:57 ` cvs-commit at gcc dot gnu.org 2021-08-25 2:32 ` pinskia at gcc dot gnu.org 2021-11-04 8:10 ` cvs-commit at gcc dot gnu.org 2022-09-25 19:35 ` ak at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-101989-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).