[SLOF] [PATCH 3/4] fbuffer: Implement MRMOVE as an accelerated primitive

Benjamin Herrenschmidt benh at au1.ibm.com
Sat Sep 12 15:28:07 AEST 2015


On Sat, 2015-09-12 at 00:41 +0200, Thomas Huth wrote:

>  	register unsigned long r5 asm("r5") = arg2.u;
>  	register unsigned long r6 = entry.u         ;
>  
> -	asm volatile("mflr 31 ; mtctr %4 ; bctrl ; mtlr 31"
> +	asm volatile(" mtctr %4 ; bctrl "
>  		     : "=r" (r3)
>  		     : "r" (r3), "r" (r4), "r" (r5), "r" (r6)
>  		     : "ctr", "r6", "r7", "r8", "r9", "r10", "r11",
> -		       "r12", "r13", "r31", "lr", "cc");
> +		       "r12", "r13", "lr", "cc");
>  
>  	return r3;
>  }

That looks completely bogus. gcc has no idea that this is calling out
and thus requires creation of a stack frame. Any reason why you can't
just do a normal function pointer call ? (Maybe creating a little OPD
on the stack).

Cheers,
Ben.



More information about the SLOF mailing list