From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 976 invoked by alias); 19 Apr 2009 17:50:08 -0000 Received: (qmail 960 invoked by uid 22791); 19 Apr 2009 17:50:06 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp116.sbc.mail.sp1.yahoo.com (HELO smtp116.sbc.mail.sp1.yahoo.com) (69.147.64.89) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sun, 19 Apr 2009 17:49:59 +0000 Received: (qmail 23360 invoked from network); 19 Apr 2009 17:49:57 -0000 Received: from unknown (HELO ?192.168.1.102?) (TimothyPrince@99.13.231.72 with plain) by smtp116.sbc.mail.sp1.yahoo.com with SMTP; 19 Apr 2009 17:49:56 -0000 Message-ID: <49EB6444.8040904@sbcglobal.net> Date: Sun, 19 Apr 2009 17:50:00 -0000 From: Tim Prince Reply-To: tprince@computer.org User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: Martin Ettl CC: gcc-help@gcc.gnu.org Subject: Re: What optimizaton flags should i use (g++-4.3.3,Linux,Core2Duo)? References: <20090419151801.146500@gmx.net> In-Reply-To: <20090419151801.146500@gmx.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2009-04/txt/msg00242.txt.bz2 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= 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.