public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jgarzik at pobox dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/47000] New: Major performance regression in parallel SSE2 impl of SHA256 hash algorithm Date: Sat, 18 Dec 2010 07:46:00 -0000 [thread overview] Message-ID: <bug-47000-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47000 Summary: Major performance regression in parallel SSE2 impl of SHA256 hash algorithm Product: gcc Version: 4.5.1 Status: UNCONFIRMED Severity: major Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: jgarzik@pobox.com Created attachment 22805 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22805 4-way SHA256 implementation, whose performance decreases markedly 4.4.x -> 4.5.x OS: Fedora 14 My "cpuminer" open source project is -very- sensitive to performance of generated code, and experiences a severe performance regression going from gcc 4.4.x to 4.5.x. Our program core is essentially for (n = 0; n < 0xffffff; n++) sha256( sha256( data ) ) /* one iteration of inner loop */ Building with gcc 4.4.5 -or- Fedora 13 gcc (4.4.x derivative), we achieve 1850.85 kilo-iterations per second Building with gcc 4.5.1 -or- Fedora 14 gcc (4.5.x derivative), we achieve 1389.82 kilo-iterations per second This is a significant performance decrease, and the only variable is the compiler. I have presented x86_64 data below, but similar slowdowns are seen on i686-mingw in Fedora 13 (fast gcc 4.4.x) or Fedora 14 (slow gcc 4.5.x). This interesting variant of the standard SHA256 algorithm is implemented using Intel/AMD SSE2-specific operations, effectively running four (4) SHA256 iterations in parallel, generating four (4) SHA256 hashes on four distinct datasets. See attachment sha256_4way.i. -------------------------------------------------------------------------- fast, working gcc -v: Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../src/gcc-4.4.5/configure --prefix=/garz/gcc44 --enable-languages=c Thread model: posix gcc version 4.4.5 (GCC) -------------------------------------------------------------------------- slow, broken gcc -v: Using built-in specs. COLLECT_GCC=/garz/gcc45/bin/gcc COLLECT_LTO_WRAPPER=/garz/gcc45/libexec/gcc/x86_64-unknown-linux-gnu/4.5.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../src/gcc-4.5.1/configure --prefix=/garz/gcc45 --enable-languages=c Thread model: posix gcc version 4.5.1 (GCC)
next reply other threads:[~2010-12-18 7:46 UTC|newest] Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-12-18 7:46 jgarzik at pobox dot com [this message] 2010-12-18 7:48 ` [Bug c/47000] " jgarzik at pobox dot com 2010-12-18 12:27 ` [Bug target/47000] " steven at gcc dot gnu.org 2010-12-18 12:39 ` steven at gcc dot gnu.org 2010-12-18 12:49 ` steven at gcc dot gnu.org 2010-12-18 15:36 ` hjl.tools at gmail dot com 2010-12-18 15:41 ` hjl.tools at gmail dot com 2010-12-18 15:43 ` hjl.tools at gmail dot com 2010-12-18 16:04 ` hjl.tools at gmail dot com 2010-12-18 18:24 ` jgarzik at pobox dot com 2010-12-18 18:49 ` jgarzik at pobox dot com 2010-12-18 19:08 ` jgarzik at pobox dot com 2010-12-18 19:09 ` jgarzik at pobox dot com 2010-12-18 19:21 ` steven at gcc dot gnu.org 2010-12-18 19:35 ` [Bug target/47000] [4.5 Regression] Failure to inline SSE intrinsics hjl.tools at gmail dot com 2010-12-18 19:39 ` hjl.tools at gmail dot com 2010-12-18 20:26 ` jakub at gcc dot gnu.org 2010-12-18 21:15 ` jgarzik at pobox dot com 2010-12-18 21:16 ` jgarzik at pobox dot com 2010-12-18 21:17 ` jgarzik at pobox dot com 2010-12-18 21:26 ` jgarzik at pobox dot com 2010-12-19 11:50 ` hubicka at ucw dot cz 2010-12-19 11:53 ` hubicka at gcc dot gnu.org 2010-12-19 11:58 ` hubicka at gcc dot gnu.org 2010-12-20 8:32 ` jakub at gcc dot gnu.org 2010-12-21 10:31 ` hubicka at gcc dot gnu.org 2010-12-21 10:39 ` hubicka at gcc dot gnu.org 2010-12-28 14:57 ` rguenth at gcc dot gnu.org 2011-03-08 13:20 ` rguenth at gcc dot gnu.org 2011-04-28 15:28 ` rguenth at gcc dot gnu.org 2012-07-02 10:28 ` 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-47000-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).