This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Does SIMD optimization of GCC 3.4.6 work?
- From: Ian Lance Taylor <iant at google dot com>
- To: zhou13 at netscape dot net
- Cc: gcc at gcc dot gnu dot org
- Date: 05 Jul 2006 07:50:52 -0700
- Subject: Re: Does SIMD optimization of GCC 3.4.6 work?
- References: <27FCB31C.631AD4D6.000711F2@netscape.net>
This question is not appropriate for the gcc@gcc.gnu.org mailing list.
It would be appropriate on the gcc-help@gcc.gnu.org mailing list.
Thanks.
zhou13@netscape.net writes:
> I am wondering if i have used -O, -O2 or -O3, do i still benifit from
> flags such as -march -fmpmath -ffast-math -mmx -sse -sse2 -3dnow?
Yes, although the effects will depend on your code. In particular
those options will mainly affect floating point code. And you may
want to use -mtune as well.
> I am optimizing a video codec and i see barely any performance
> difference whether i use just -O2 or "-ffast-math -march=athlon-xp
> -mmmx -msse -msse2 -m3dnow -mfpmath=sse,387 -O3".
I recommend approaching this as you would any performance problem: use
a profiler to identify the slowest parts of your code, and see what
you can do to make them faster. It may be helpful to look at the
generated assembly code: compile with the --save-temps option and look
at the .s file.
Ian