This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What optimizaton flags should i use (g++-4.3.3,Linux,Core2Duo)?


If you rely on IEEE behaviors, you can't use fast-math.  See the gcc
info page for more information regarding that.  fast-math is actually
a collection of options.  You can probably try to figure out a subset
of fast-math that will work for you (for example, you can turn off
setting of errno and turn off signaling NaN and most likely this won't
break your code).

  Brian

On Mon, Apr 20, 2009 at 11:30 PM, Martin Ettl <ettl.martin@gmx.de> wrote:
> Thank you for the tip.
> But if i use the -ffast-math option, the result is computed fast but result of my computation is wrong! I am using a lots of double operations and <cmath> functions.
>
> Is this a known issue?
>
> Best regards
>
> Martin
>
>
> -------- Original-Nachricht --------
>> Datum: Mon, 20 Apr 2009 12:23:19 -0700
>> Von: Ian Lance Taylor <iant@google.com>
>> An: tprince@computer.org
>> CC: Martin Ettl <ettl.martin@gmx.de>, gcc-help@gcc.gnu.org
>> Betreff: Re: What optimizaton flags should i use (g++-4.3.3,Linux,Core2Duo)?
>
>> 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
>
> --
> Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]