some suggestions

Marc Lehmann pcg@goof.com
Mon Jan 19 02:25:00 GMT 1998


IMHO the unrolling code in egcs should deserve much more testing... Loop
unrolling (even the "deprecated! -funroll-all-loops) used to give me big
speed improvement on pentiums (esp. but not limited to fpu-code). Recently
I received a report about degraded performance with loop unrolling and amd's..

I verified it (with pgcc, not with egcs) and indeed loop unrolling seems to
make the whole issue worse.. I don't check this often, so I don't know when
exactly the slowdown occured.

The whole loop optimization pass is very important for pentium performance,
but instead of adding new optimizations we should first check what we can
get from the existing optimizations, say, haifa and loop unrolling.

For example, a more intelligent decision of when to unroll might be
fortunate... the pentium (not ppro) needs three iterations through code
until it get's full speed.. -funroll-all-loops performed better then
-funroll-loops alone, yet unrolling all loops definitely is a bad idea,
given that much code is only executed a small number of times.

Also, floating point loops might get a larger advantage of unrolling, since
we have 8 available fpu registers (well, if the x86 only had a sane
instruction set :(

      -----==-                                              |
      ----==-- _                                            |
      ---==---(_)__  __ ____  __       Marc Lehmann       +--
      --==---/ / _ \/ // /\ \/ /       pcg@goof.com       |e|
      -=====/_/_//_/\_,_/ /_/\_\                          --+
    The choice of a GNU generation                        |
                                                          |



More information about the Gcc mailing list