[PATCH, rs6000] Predefine __PPU__ to indicate -mcpu=cell

Ulrich Weigand uweigand@de.ibm.com
Sun Aug 10 16:05:00 GMT 2008


Andrew Pinski wrote:
> On Sat, Aug 9, 2008 at 6:11 AM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
> > Hello,
> >
> > the C/C++ Language Extensions document for the Cell/B.E. specifies that
> > compilers for the Cell PPU should predefine the __PPU__ macro, and e.g.
> > XLC and our current out-of-tree builds of GCC do so.
> >
> > This patch adds that define to the FSF GCC version as well.
> >
> > Tested on powerpc64-linux.
> >
> > OK for mainline and 4.3?
> 
> This will cause __PPU__ to defined if we use -mcpu=970 -mtune=cell
> which is most likely not what we want to do.
> rs6000_cpu is really the tunning setting rather than the cpu setting.

I see, it seems I have misinterpreted existing code like
  if (rs6000_cpu == PROCESSOR_PPC405)
    builtin_define ("__PPC405__");

David, do you have any suggestions how to properly check for -mcpu=cell?
It seems this information is not actually available anywhere ...

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com



More information about the Gcc-patches mailing list