public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Enabling sse2 support on pentium4 makes my fortran-program slower.
@ 2002-10-14  6:21 Mikko Ranta
  2002-10-15  0:54 ` Miguel Ramírez
  0 siblings, 1 reply; 2+ messages in thread
From: Mikko Ranta @ 2002-10-14  6:21 UTC (permalink / raw)
  To: gcc-help

Hello!

I have a fortran 77 -code which calculates three-body problem of celestial 
mechanics so it has lot's of floating point arithemtics in it. I'm using 
Mingw at Windows and g77 from the newest version 3.2.My computer is 1.8Ghz 
Pentium4.In your homepage you say that enabling sse2 support with commands 
-msse2 (or march=pentium4) and -mfpmath=sse should increase speed of 
floating point arithmetics considerably. Examining my computer with Sisoft 
Sandra's arithmetic benchmark reveals that using sse2 should increase 
floating point arithmetics over 200%. To the point. When I enable options 
mentioned earlier, my program doesn't run any faster.In fact it runs even a 
little slower. Do I make some mistake. Or is it because all SIMD features 
are not yet implemented on GCC. Pentium 4 doesn't really shine on floating 
point arithmetics without sse2(in fact by Sisoft Sandra it's slower than my 
older computer Duron 800!) so enabling full sse2 is crucial for using this 
program which can calculate orbits for weeks. Any help or suggestions would 
be highly appreciated.

Thanks in advance.
Mikko Ranta

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx

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

* Re: Enabling sse2 support on pentium4 makes my fortran-program slower.
  2002-10-14  6:21 Enabling sse2 support on pentium4 makes my fortran-program slower Mikko Ranta
@ 2002-10-15  0:54 ` Miguel Ramírez
  0 siblings, 0 replies; 2+ messages in thread
From: Miguel Ramírez @ 2002-10-15  0:54 UTC (permalink / raw)
  To: Mikko Ranta, gcc-help


> Hello!
>
> I have a fortran 77 -code which calculates three-body problem of celestial
> mechanics so it has lot's of floating point arithemtics in it. I'm using
> Mingw at Windows and g77 from the newest version 3.2.My computer is 1.8Ghz
> Pentium4.In your homepage you say that enabling sse2 support with commands
> -msse2 (or march=pentium4) and -mfpmath=sse should increase speed of
> floating point arithmetics considerably. Examining my computer with Sisoft
> Sandra's arithmetic benchmark reveals that using sse2 should increase
> floating point arithmetics over 200%. To the point. When I enable options
> mentioned earlier, my program doesn't run any faster.In fact it runs even
a
> little slower. Do I make some mistake. Or is it because all SIMD features
> are not yet implemented on GCC. Pentium 4 doesn't really shine on floating
> point arithmetics without sse2(in fact by Sisoft Sandra it's slower than
my
> older computer Duron 800!) so enabling full sse2 is crucial for using this
> program which can calculate orbits for weeks. Any help or suggestions
would
> be highly appreciated.
>

Hi,

sse2 optimizations don't come for free: if you want to get real performance
improvement
you have to ensure that your program is written in a way that makes possible
to
take advantage of SIMD instructions:

       + Memory has to be aligned into 16-byte boundaries.
       + Your data structures must expose parallelism
       + Keep in-innerloop conditionals to a minimum
       + Avoid data dependences between vector elements
       + etc.

There are no free lunches out there!

Miguel.


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

end of thread, other threads:[~2002-10-15  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-14  6:21 Enabling sse2 support on pentium4 makes my fortran-program slower Mikko Ranta
2002-10-15  0:54 ` Miguel Ramírez

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