[PATCH 1/2] powerpc: string: implement optimized memset variants

Michael Ellerman mpe at ellerman.id.au
Tue Mar 28 11:44:30 AEDT 2017


"Naveen N. Rao" <naveen.n.rao at linux.vnet.ibm.com> writes:

> diff --git a/arch/powerpc/lib/mem_64.S b/arch/powerpc/lib/mem_64.S
> index 85fa9869aec5..ec531de99996 100644
> --- a/arch/powerpc/lib/mem_64.S
> +++ b/arch/powerpc/lib/mem_64.S
> @@ -13,6 +13,23 @@
>  #include <asm/ppc_asm.h>
>  #include <asm/export.h>
>  
> +_GLOBAL(__memset16)
> +	rlwimi	r4,r4,16,0,15
> +	/* fall through */
> +
> +_GLOBAL(__memset32)
> +	rldimi	r4,r4,32,0
> +	/* fall through */
> +
> +_GLOBAL(__memset64)
> +	neg	r0,r3
> +	andi.	r0,r0,7
> +	cmplw	cr1,r5,r0
> +	b	.Lms
> +EXPORT_SYMBOL(__memset16)
> +EXPORT_SYMBOL(__memset32)
> +EXPORT_SYMBOL(__memset64)

You'll have to convince me that's better than what GCC produces.

cheers


More information about the Linuxppc-dev mailing list