[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] Disabling hardware speculation support in GCC flags

On Sat, 6 Dec 2008 22:13:46 +1100
Paul Mackerras <paulus@samba.org> wrote:

> Amit Uttamchandani writes:
> > I'm learning the PPC architecture and I have a PowerBook G4 (7410)
> > 500MHz. Looking at the datasheet for the processor, it has support for
> > hardware speculation which allows out-of-order execution.
> > 
> > I wanted to test program run times by compiling using gcc with flags
> > that enable and then disable support for this hardware speculation
> > feature. This is just to see the difference between program run times.
> > 
> > Any ideas which flags/options I should be using in gcc?
> It's not something that gcc has any control over.  In fact there isn't
> any way to turn off the out-of-order execution that I know of.
> Paul.

Thanks for the reply.

You're right, I guess we can't disable the "hardware" directly but if
we let gcc know about this then it is possible that it will do further
optimizations correct?

For example, I can compile a C program using regular gcc without any
options and then adding the following and comparing the differences:

"-mcpu=7400 -O2 -pipe -maltivec -mabi=altivec"

This way the compiler "knows" about the hardware and tries to optimize
the program based on that.

What do you think?


Reply to: