[Cbe-oss-dev] [RFC, PATCH] selection of CPU optimization

Arnd Bergmann arnd at arndb.de
Fri Apr 13 10:10:47 EST 2007


On Thursday 12 April 2007, Segher Boessenkool wrote:
> > What would be the right options to pass on e200 and on
> > pa6t?
> 
> The best thing would be to add GCC -mcpu= options.  For
> now, you're probably best of with -mcpu=powerpc and
> -mcpu=powerpc64 resp., i.e. the "blended models".  This
> is a good option for multiplatform kernels too; add -mtune=
> to optimise for a specific core, but it will *work* on
> the whole family.

We already have makefile magic to test if gcc supports a flag
and fall back to some other one if not.

After looking at rs6000.c, I found that we can probably
reduce the number of different -mcpu= options to 16 and only
have separate -mtune= options for each specific cpu.

My understanding at this point is that we can always fall back
to -mcpu=powerpc or -mcpu=powerpc64, and also

(401, 505, power, power2, rsc) -> not supported

403 -> -mcpu=403
(405, 440) -> -mcpu=405
(e500, 85xx) -> -mcpu=8540
601 -> -mcpu=601
(6xx, g3, g4, e300, e600) -> -mcpu=603
(ec603e, e200, 82xx) -> -mcpu=ec603e
(8xx) -> -mcpu=860

(power3, rs64) -> -mcpu=power3
power4 -> -mcpu=power4 >> -mcpu=power3
970 -> -mcpu=970 >> -mcpu=power4
cell -> -mcpu=cell >> -mcpu=970
power5 -> -mcpu=power5 >> -mcpu=power4
power5+ -> -mcpu=power5+ >> -mcpu=power5
power6 -> -mcpu=power6 >> -mcpu=power5+
power6x -> -mcpu=power6x >> -mcpu=power6
pa6t -> -mcpu=pa6t >> (???)

So if we select e.g. power6 and cell, it needs to fall back to power4,
which is the common subset. Selecting both 403 and 405 would result
in falling back to -mcpu=powerpc, because they don't have any larger
subset.

I'm not sure what the right fallback fo pa6t should be. I would guess
that it's a superset of power6x and 970 when considering the kernel,
but it's not entirely clear what the fallback should be.

	Arnd <><



More information about the cbe-oss-dev mailing list