Does SIMD optimization of GCC 3.4.6 work?
Ian Lance Taylor
iant@google.com
Wed Jul 5 14:51:00 GMT 2006
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
More information about the Gcc
mailing list