public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "i.nixman at autistici dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/107546] New: simd, redundant pcmpeqb and pxor Date: Mon, 07 Nov 2022 06:39:28 +0000 [thread overview] Message-ID: <bug-107546-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107546 Bug ID: 107546 Summary: simd, redundant pcmpeqb and pxor Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: i.nixman at autistici dot org Target Milestone: --- Hello, this code sample(https://godbolt.org/z/TnGMsfMs6): ``` #include <x86intrin.h> auto foo(const char *p) { const auto substr = _mm_loadu_si128((const __m128i *)p); return _mm_cmplt_epi8(substr, _mm_set1_epi8('0')); } ``` produces the following ASM code: ``` 1: foo(char const*): 2: movdqu xmm0, XMMWORD PTR [rdi] 3: pxor xmm1, xmm1 4: pcmpgtb xmm0, XMMWORD PTR .LC0[rip] 5: pcmpeqb xmm0, xmm1 6: ret ``` please look at line 5. is there any reason for `pcmpeqb` and `pxor` instruction? just for info, clang's output(https://godbolt.org/z/MPnvEMdhr): ``` 1: foo(char const*): 2: movdqu xmm1, xmmword ptr [rdi] 3: movdqa xmm0, xmmword ptr [rip + .LCPI0_0] 4: pcmpgtb xmm0, xmm1 5: ret ``` it looks like the issue started at version 9 and up to the current trunk.
next reply other threads:[~2022-11-07 6:39 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-07 6:39 i.nixman at autistici dot org [this message] 2022-11-07 6:51 ` [Bug target/107546] " pinskia at gcc dot gnu.org 2022-11-07 6:58 ` [Bug target/107546] [10/11/12/13 Regression] " pinskia at gcc dot gnu.org 2022-11-07 7:07 ` rguenth at gcc dot gnu.org 2022-11-07 7:07 ` crazylht at gmail dot com 2022-11-07 7:14 ` crazylht at gmail dot com 2022-11-07 7:16 ` glisse at gcc dot gnu.org 2022-11-07 7:20 ` pinskia at gcc dot gnu.org 2022-11-07 8:27 ` crazylht at gmail dot com 2022-11-07 10:22 ` jakub at gcc dot gnu.org 2022-11-07 12:02 ` jakub at gcc dot gnu.org 2022-11-07 12:05 ` i.nixman at autistici dot org 2022-11-07 13:47 ` i.nixman at autistici dot org 2022-11-08 11:24 ` cvs-commit at gcc dot gnu.org 2022-11-08 11:59 ` [Bug target/107546] [10/11/12 " jakub at gcc dot gnu.org 2022-11-10 10:48 ` cvs-commit at gcc dot gnu.org 2023-07-07 10:44 ` [Bug target/107546] [11/12 " rguenth 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-107546-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).