Re: [PATCH] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions

2013-11-08 Thread Stephen Boyd
On 11/08/13 09:02, Måns Rullgård wrote: > Stephen Boyd writes: > >> +int __aeabi_idiv(int numerator, int denominator) >> +{ >> +if (static_key_false(&cpu_has_idiv)) { >> +int ret; >> + >> +asm volatile ( >> +".arch_extension idiv\n" >> +"sdiv %0,

Re: [PATCH] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions

2013-11-08 Thread Stephen Boyd
On 11/08/13 08:52, Russell King - ARM Linux wrote: > On Fri, Nov 08, 2013 at 10:58:42AM +0100, Jean-Christophe PLAGNIOL-VILLARD > wrote: >> On 11:20 Thu 07 Nov , Stephen Boyd wrote: >>> @@ -381,6 +384,13 @@ static void __init cpuid_init_hwcaps(void) >>> elf_hwcap |= HWCAP_IDIVT; >>

Re: [PATCH] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions

2013-11-08 Thread Stephen Boyd
On 11/08/13 08:48, Christopher Covington wrote: > Hi Stephen, > > On 11/07/2013 02:20 PM, Stephen Boyd wrote: >> If we're running on a v7 ARM CPU, detect if the CPU supports the >> sdiv/udiv instructions and replace the signed and unsigned >> division library functions with an sdiv/udiv instruction

Re: [PATCH] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions

2013-11-08 Thread Stephen Boyd
On 11/08/13 08:54, Russell King - ARM Linux wrote: > On Fri, Nov 08, 2013 at 12:50:04PM +0100, Jean-Christophe PLAGNIOL-VILLARD > wrote: >> On 19:34 Thu 07 Nov , Rob Herring wrote: >>> On Thu, Nov 7, 2013 at 1:20 PM, Stephen Boyd wrote: If we're running on a v7 ARM CPU, detect if the CPU

Re: [PATCH] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions

2013-11-08 Thread Måns Rullgård
Stephen Boyd writes: > +int __aeabi_idiv(int numerator, int denominator) > +{ > + if (static_key_false(&cpu_has_idiv)) { > + int ret; > + > + asm volatile ( > + ".arch_extension idiv\n" > + "sdiv %0, %1, %2" > + : "=&r" (ret) There

Re: [PATCH] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions

2013-11-08 Thread Russell King - ARM Linux
On Fri, Nov 08, 2013 at 12:50:04PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 19:34 Thu 07 Nov , Rob Herring wrote: > > On Thu, Nov 7, 2013 at 1:20 PM, Stephen Boyd wrote: > > > If we're running on a v7 ARM CPU, detect if the CPU supports the > > > sdiv/udiv instructions and replace

Re: [PATCH] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions

2013-11-08 Thread Russell King - ARM Linux
On Fri, Nov 08, 2013 at 10:58:42AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 11:20 Thu 07 Nov , Stephen Boyd wrote: > > @@ -381,6 +384,13 @@ static void __init cpuid_init_hwcaps(void) > > elf_hwcap |= HWCAP_IDIVT; > > } > > > > +#ifdef CONFIG_THUMB2_KERNEL > if (IS_

Re: [PATCH] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions

2013-11-08 Thread Christopher Covington
Hi Stephen, On 11/07/2013 02:20 PM, Stephen Boyd wrote: > If we're running on a v7 ARM CPU, detect if the CPU supports the > sdiv/udiv instructions and replace the signed and unsigned > division library functions with an sdiv/udiv instruction. [...] > +++ b/arch/arm/lib/div-v7.c > @@ -0,0 +1,58

Re: [PATCH] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions

2013-11-08 Thread Jean-Christophe PLAGNIOL-VILLARD
On 19:34 Thu 07 Nov , Rob Herring wrote: > On Thu, Nov 7, 2013 at 1:20 PM, Stephen Boyd wrote: > > If we're running on a v7 ARM CPU, detect if the CPU supports the > > sdiv/udiv instructions and replace the signed and unsigned > > division library functions with an sdiv/udiv instruction. > >

Re: [PATCH] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions

2013-11-08 Thread Jean-Christophe PLAGNIOL-VILLARD
On 11:20 Thu 07 Nov , Stephen Boyd wrote: > If we're running on a v7 ARM CPU, detect if the CPU supports the > sdiv/udiv instructions and replace the signed and unsigned > division library functions with an sdiv/udiv instruction. > > Running the perf messaging benchmark in pipe mode > > $ pe

Re: [PATCH] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions

2013-11-07 Thread Rob Herring
On Thu, Nov 7, 2013 at 1:20 PM, Stephen Boyd wrote: > If we're running on a v7 ARM CPU, detect if the CPU supports the > sdiv/udiv instructions and replace the signed and unsigned > division library functions with an sdiv/udiv instruction. [snip] > diff --git a/arch/arm/lib/Makefile b/arch/arm/l

[PATCH] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions

2013-11-07 Thread Stephen Boyd
If we're running on a v7 ARM CPU, detect if the CPU supports the sdiv/udiv instructions and replace the signed and unsigned division library functions with an sdiv/udiv instruction. Running the perf messaging benchmark in pipe mode $ perf bench sched messaging -p shows a modest improvement on m