This is the mail archive of the gcc@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]

Re: x86 double alignment (was egcs-1.1 release schedule)



  In message <19980628214914.40045@cerebro.laendle>you write:
  > I had this on by default for half a year in pgcc (until I was told about
  > windows having problems). It isn't beneficial for integer programs, and
  > there are a great many of them around. I'm not happy with the idea
  > of punishing a whole class of functions.
  > 
  > If all third-party libraries (e.g. libc) were compiled with this switch (we
  > only need to have this on for functions using callbacks), we could leave the
  > choice up to the individual program.
I'm not particularly happy with it either, but sometimes that's the
tradeoff we have to make.

What we have to do is quantify the integer slowdowns and the floating
point speedups and make a value decision about which is more important.

This is a common thing to have to do when optimizing code -- few things
are always going to be a win.  So you have to evaluate how often they
win vs how often they lose -- you do this both with benchmarks and 
instinct.

The other thing to do is look for cases where you can mitigate the
losses.  The example that has come up is leaf functions.

I must admit that I'm curious how much slowdown we're going to see
for integer code.  I'd expect it to be rather small, but I must admit
that I don't really know for sure.

  > Educate your users. I thought that way for a great long time, maybe I'm
  > used to tweaking switches, but thats _already_ the case with loop unrolling
  > or "-O3 vs. -O2". Why isn't loop unrolling on by default? Why Do most
  > programs use -O2 when -O3 is faster?
That's fine for a hacker community.  That doesn't work for a the larger
developer community.

Loop unrolling is very much a hit or miss proposition.  It's just as
likely to make things worse as it is to make them better.

-O3 can make code run slower, it can make the compiler run slower,
it makes debugging even harder.  It can also make things run faster,
it really depends on the code.

jeff


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