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: GCC 4.5 Optimization Problem


On Thu, May 5, 2011 at 2:27 PM, Abdurrahman Carkacioglu
<carkaci@gmail.com> wrote:
> Something like following code.
>
> http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c
>

fast-math will not typically affect this code.  The math here is
primarily integer arithmetic, and has a lot of loops.  Are you
generating floating point random numbers?  If so, and you can afford
the small precision penalty, you could precompute the divisions as
reciprocals, which are then multiplied at runtime.  Otherwise, you'll
need a profiler to guide you to the problematic lines of code.

If you can narrow it down to a missed loop-unroll or something
similar, likely someone on this list (other than me :) ) will be able
to help you further.

  Brian


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