power and percpu: Could we move the paca into the percpu area?

Gabriel Paubert paubert at iram.es
Fri Jun 13 21:55:53 EST 2014


On Thu, Jun 12, 2014 at 07:26:39AM -0500, Segher Boessenkool wrote:
> > Actually, from gcc/config/rs6000.h:
> > 
> > /* 1 for registers that have pervasive standard uses
> >    and are not available for the register allocator.
> 
> [snip]
> 
> > So cr5, which is number 73, is never used by gcc. 
> 
> Not available for RA is not the same thing at all as not used by GCC.
> For example, GPR1 and XER[CA] are also fixed regs.

Indeed, I should have been more clear, it is never explicitly reserved
by any ABI like GPR1 for the stack pointer nor used implicitly by any pattern
like the carry (which is also never allocated, but used or clobbered
by many patterns). However no machine description pattern uses cr5.

The line "cr5 is not supposed to be used" has always been a mystery
to me, but gcc has always obeyed this rule. If memory serves it has 
been in rs6000.h since I got my first PPC board in 1997.

> 
> But, indeed, it does look like GCC doesn't use it.  It seems to me that
> some ABI forbade userland (or non-libraries or whatever) from using it.
> I'll see what I can find out.
> 

Take what I say with a grain of salt, but I always had the impression that
it was a remnant from the first port of GCC to Power, which could well have 
been AIX. This first port might have been done by Richard Kenner.

Actually, a long time ago (1999-2000?) I toyed with he idea of using cr5 for 
soft masking of interrupts on PPC32. But I got distracted by other things
and never came around to it.

	Gabriel


More information about the Linuxppc-dev mailing list