public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/47000] New: Major performance regression in parallel SSE2 impl of SHA256 hash algorithm
@ 2010-12-18  7:46 jgarzik at pobox dot com
  2010-12-18  7:48 ` [Bug c/47000] " jgarzik at pobox dot com
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: jgarzik at pobox dot com @ 2010-12-18  7:46 UTC (permalink / raw)
  To: gcc-bugs

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)


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

end of thread, other threads:[~2012-07-02 10:28 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-18  7:46 [Bug c/47000] New: Major performance regression in parallel SSE2 impl of SHA256 hash algorithm jgarzik at pobox dot com
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

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).