From: Ian Lance Taylor <iant@google.com>
To: tprince@computer.org
Cc: Martin Ettl <ettl.martin@gmx.de>, gcc-help@gcc.gnu.org
Subject: Re: What optimizaton flags should i use (g++-4.3.3,Linux,Core2Duo)?
Date: Mon, 20 Apr 2009 19:23:00 -0000 [thread overview]
Message-ID: <m363gzgme0.fsf@google.com> (raw)
In-Reply-To: <49EB6444.8040904@sbcglobal.net> (Tim Prince's message of "Sun\, 19 Apr 2009 10\:49\:56 -0700")
Tim Prince <TimothyPrince@sbcglobal.net> writes:
> Martin Ettl wrote:
>
>> i am playing around with g++-4.3.3 on Ubuntu Linux. The project i am working does a lot of floating point arithmetic (based on double variables). The testplattform i use, is a intel core 2 duo processor. So what optimization flags are good for this plattform? Currently i am using -O3 -funroll-loops, but there are a plenty other.
>>
> If you are using the 64-bit compiler, this may be sufficient, but
> --param max-unrolled-insns=<your choice>
> or
> --param max-unroll-times=4
> may be useful to make the unrolling less aggressive.
>
> I suppose you're not using the 32-bit compiler, where you would set
> -march=pentium-m
> or
> -march=prescott
> or some other option, to enable partial or full use of sse2.
>
> Add -msse3 if you like (either 32- or 64-bit), but you probably have no
> use for it.
>
> -fassociative-math (or, if it doesn't work, -ffast-math) are required for
> vectorization of sum reductions. Otherwise, they may be undesirable.
> They are saner in gfortran than in g++.
>
> If you use OpenMP, of course you would set -fopenmp.
Other options to consider are -mfpmath=sse and -ffast-math.
Ian
next prev parent reply other threads:[~2009-04-20 19:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-19 15:18 Martin Ettl
2009-04-19 17:50 ` Tim Prince
2009-04-19 20:05 ` Matthew Lai
2009-04-20 19:23 ` Ian Lance Taylor [this message]
2009-04-21 6:31 ` Martin Ettl
2009-04-21 6:39 ` Brian Budge
2009-04-22 15:34 ` Bob Plantz
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=m363gzgme0.fsf@google.com \
--to=iant@google.com \
--cc=ettl.martin@gmx.de \
--cc=gcc-help@gcc.gnu.org \
--cc=tprince@computer.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: link
Be 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).