public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105429] Unnecessary moves generated with _mm_crc32_u64 Date: Fri, 29 Apr 2022 12:30:08 +0000 [thread overview] Message-ID: <bug-105429-4-hpuHsx7RBL@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105429-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105429 --- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> --- The intrinsic is defined as: unsinged __int64 _mm_crc32_u64( unsinged __int64 crc, unsigned __int64 data ) and the unnecessary move is in fact zero-extend: movl %eax, %eax # 16 [c=1 l=2] *zero_extendsidi2/3 You probably want: uint32_t crc(uint64_t current, const uint8_t *buffer, size_t size) { for(size_t i = 0; i < size; i++) current = _mm_crc32_u64(current, buffer[i]); return current; }
next prev parent reply other threads:[~2022-04-29 12:30 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-28 20:02 [Bug other/105429] New: Unnecessary moves generated by the compiler mareksz1958 at wp dot pl 2022-04-28 20:04 ` [Bug target/105429] Unnecessary moves generated with _mm_crc32_u64 pinskia at gcc dot gnu.org 2022-04-29 12:30 ` ubizjak at gmail dot com [this message] 2022-04-29 12:38 ` kspalaiologos at gmail dot com
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-105429-4-hpuHsx7RBL@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).