Re: [PATCH] powerpc: inline current_stack_pointer()

2016-05-31 Thread Anton Blanchard via Linuxppc-dev
Hi, > current_stack_pointeur() is a single instruction function. it > It is not worth breaking the execution flow with a bl/blr for a > single instruction Check out bfe9a2cfe91a ("powerpc: Reimplement __get_SP() as a function not a define") to see why we made it a function. Anton

Re: [PATCH] powerpc: inline current_stack_pointer()

2016-05-24 Thread Paul Mackerras
On Mon, May 23, 2016 at 07:17:38PM +0200, Gabriel Paubert wrote: > On Mon, May 23, 2016 at 10:46:02AM +0200, Christophe Leroy wrote: > > current_stack_pointeur() is a single instruction function. it > > It is not worth breaking the execution flow with a bl/blr for a > > single instruction > > Are

Re: [PATCH] powerpc: inline current_stack_pointer()

2016-05-24 Thread Gabriel Paubert
On Mon, May 23, 2016 at 10:46:02AM +0200, Christophe Leroy wrote: > current_stack_pointeur() is a single instruction function. it > It is not worth breaking the execution flow with a bl/blr for a > single instruction Are you sure that the result is always the same? Calling an external function

Re: [PATCH] powerpc: inline current_stack_pointer()

2016-05-24 Thread Segher Boessenkool
On Tue, May 24, 2016 at 07:39:59AM +0200, Christophe Leroy wrote: > >>+static inline unsigned long current_stack_pointer(void) > >>+{ > >>+ register unsigned long *ptr asm("r1"); > >>+ > >>+ return *ptr; > >>+} > >Register asm is only guaranteed to work as input to inline asm. NAK. > > > Does

Re: [PATCH] powerpc: inline current_stack_pointer()

2016-05-23 Thread Christophe Leroy
Le 23/05/2016 à 22:22, Segher Boessenkool a écrit : On Mon, May 23, 2016 at 10:46:02AM +0200, Christophe Leroy wrote: +static inline unsigned long current_stack_pointer(void) +{ + register unsigned long *ptr asm("r1"); + + return *ptr; +} Register asm is only guaranteed to work as

Re: [PATCH] powerpc: inline current_stack_pointer()

2016-05-23 Thread Segher Boessenkool
On Mon, May 23, 2016 at 10:46:02AM +0200, Christophe Leroy wrote: > +static inline unsigned long current_stack_pointer(void) > +{ > + register unsigned long *ptr asm("r1"); > + > + return *ptr; > +} Register asm is only guaranteed to work as input to inline asm. NAK. Segher

[PATCH] powerpc: inline current_stack_pointer()

2016-05-23 Thread Christophe Leroy
current_stack_pointeur() is a single instruction function. it It is not worth breaking the execution flow with a bl/blr for a single instruction Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/reg.h | 7 ++- arch/powerpc/kernel/misc.S | 4