Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-26 Thread Måns Rullgård
Nicolas Pitre writes: > On Thu, 26 Nov 2015, Måns Rullgård wrote: > >> Russell King - ARM Linux writes: >> >> > On Thu, Nov 26, 2015 at 12:50:08AM +, Måns Rullgård wrote: >> >> If not calling the function saves an I-cache miss, the benefit can be >> >> substantial. No, I have no proof of

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-26 Thread Måns Rullgård
Nicolas Pitre writes: > On Thu, 26 Nov 2015, Måns Rullgård wrote: > >> Russell King - ARM Linux writes: >> >> > On Thu, Nov 26, 2015 at 12:50:08AM +, Måns Rullgård wrote: >> >> If not calling the function saves an I-cache miss, the benefit can be

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Nicolas Pitre
On Thu, 26 Nov 2015, Måns Rullgård wrote: > Russell King - ARM Linux writes: > > > On Thu, Nov 26, 2015 at 12:50:08AM +, Måns Rullgård wrote: > >> If not calling the function saves an I-cache miss, the benefit can be > >> substantial. No, I have no proof of this being a problem, but it's >

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Måns Rullgård
Russell King - ARM Linux writes: > On Thu, Nov 26, 2015 at 12:50:08AM +, Måns Rullgård wrote: >> If not calling the function saves an I-cache miss, the benefit can be >> substantial. No, I have no proof of this being a problem, but it's >> something that could happen. > > That's a

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Russell King - ARM Linux
On Thu, Nov 26, 2015 at 12:50:08AM +, Måns Rullgård wrote: > If not calling the function saves an I-cache miss, the benefit can be > substantial. No, I have no proof of this being a problem, but it's > something that could happen. That's a simplistic view of modern CPUs. As I've already

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Måns Rullgård
Nicolas Pitre writes: > On Thu, 26 Nov 2015, Måns Rullgård wrote: > >> Nicolas Pitre writes: >> >> > 3) In fact I was wondering if the overhead of the branch and back is >> >really significant compared to the non trivial cost of a idiv >> >instruction and all the complex

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Nicolas Pitre
On Thu, 26 Nov 2015, Måns Rullgård wrote: > Nicolas Pitre writes: > > > On Wed, 25 Nov 2015, Stephen Boyd wrote: > > > >> The ARM compiler inserts calls to __aeabi_uidiv() and > >> __aeabi_idiv() when it needs to perform division on signed and > >> unsigned integers. If a processor has support

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Russell King - ARM Linux
On Wed, Nov 25, 2015 at 01:51:04PM -0800, Stephen Boyd wrote: > diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h > index 85e374f873ac..48c77d422a0d 100644 > --- a/arch/arm/include/asm/cputype.h > +++ b/arch/arm/include/asm/cputype.h > @@ -250,8 +250,14 @@ static inline

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Måns Rullgård
Nicolas Pitre writes: > On Wed, 25 Nov 2015, Stephen Boyd wrote: > >> The ARM compiler inserts calls to __aeabi_uidiv() and >> __aeabi_idiv() when it needs to perform division on signed and >> unsigned integers. If a processor has support for the udiv and >> sdiv division instructions the calls

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Russell King - ARM Linux
On Wed, Nov 25, 2015 at 06:09:13PM -0500, Nicolas Pitre wrote: > 3) In fact I was wondering if the overhead of the branch and back is >really significant compared to the non trivial cost of a idiv >instruction and all the complex infrastructure required to patch >those branches

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Nicolas Pitre
On Wed, 25 Nov 2015, Stephen Boyd wrote: > The ARM compiler inserts calls to __aeabi_uidiv() and > __aeabi_idiv() when it needs to perform division on signed and > unsigned integers. If a processor has support for the udiv and > sdiv division instructions the calls to these support routines > can

[PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Stephen Boyd
The ARM compiler inserts calls to __aeabi_uidiv() and __aeabi_idiv() when it needs to perform division on signed and unsigned integers. If a processor has support for the udiv and sdiv division instructions the calls to these support routines can be replaced with those instructions. Now that

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Russell King - ARM Linux
On Wed, Nov 25, 2015 at 01:51:04PM -0800, Stephen Boyd wrote: > diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h > index 85e374f873ac..48c77d422a0d 100644 > --- a/arch/arm/include/asm/cputype.h > +++ b/arch/arm/include/asm/cputype.h > @@ -250,8 +250,14 @@ static inline

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Russell King - ARM Linux
On Wed, Nov 25, 2015 at 06:09:13PM -0500, Nicolas Pitre wrote: > 3) In fact I was wondering if the overhead of the branch and back is >really significant compared to the non trivial cost of a idiv >instruction and all the complex infrastructure required to patch >those branches

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Nicolas Pitre
On Thu, 26 Nov 2015, Måns Rullgård wrote: > Nicolas Pitre writes: > > > On Wed, 25 Nov 2015, Stephen Boyd wrote: > > > >> The ARM compiler inserts calls to __aeabi_uidiv() and > >> __aeabi_idiv() when it needs to perform division on signed and > >> unsigned integers. If a

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Måns Rullgård
Nicolas Pitre writes: > On Thu, 26 Nov 2015, Måns Rullgård wrote: > >> Nicolas Pitre writes: >> >> > 3) In fact I was wondering if the overhead of the branch and back is >> >really significant compared to the non trivial cost of a idiv >> >

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Nicolas Pitre
On Wed, 25 Nov 2015, Stephen Boyd wrote: > The ARM compiler inserts calls to __aeabi_uidiv() and > __aeabi_idiv() when it needs to perform division on signed and > unsigned integers. If a processor has support for the udiv and > sdiv division instructions the calls to these support routines > can

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Måns Rullgård
Nicolas Pitre writes: > On Wed, 25 Nov 2015, Stephen Boyd wrote: > >> The ARM compiler inserts calls to __aeabi_uidiv() and >> __aeabi_idiv() when it needs to perform division on signed and >> unsigned integers. If a processor has support for the udiv and >> sdiv division

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Måns Rullgård
Russell King - ARM Linux writes: > On Thu, Nov 26, 2015 at 12:50:08AM +, Måns Rullgård wrote: >> If not calling the function saves an I-cache miss, the benefit can be >> substantial. No, I have no proof of this being a problem, but it's >> something that could

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Russell King - ARM Linux
On Thu, Nov 26, 2015 at 12:50:08AM +, Måns Rullgård wrote: > If not calling the function saves an I-cache miss, the benefit can be > substantial. No, I have no proof of this being a problem, but it's > something that could happen. That's a simplistic view of modern CPUs. As I've already

[PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Stephen Boyd
The ARM compiler inserts calls to __aeabi_uidiv() and __aeabi_idiv() when it needs to perform division on signed and unsigned integers. If a processor has support for the udiv and sdiv division instructions the calls to these support routines can be replaced with those instructions. Now that

Re: [PATCH v2 2/2] ARM: Replace calls to __aeabi_{u}idiv with udiv/sdiv instructions

2015-11-25 Thread Nicolas Pitre
On Thu, 26 Nov 2015, Måns Rullgård wrote: > Russell King - ARM Linux writes: > > > On Thu, Nov 26, 2015 at 12:50:08AM +, Måns Rullgård wrote: > >> If not calling the function saves an I-cache miss, the benefit can be > >> substantial. No, I have no proof of this