RE: [PATCH v3 2/2] powerpc: add support for csum_add()

2015-05-27 Thread David Laight
From: Scott Wood > Sent: 26 May 2015 20:43 ... > > I was thinking of all 64bit targets, not 32bit ones. > > Oh, you mean move it out of arch/powerpc? Sounds reasonable, but > someone should probably check what the resulting code looks like on > other common arches. OTOH, if we're going to modify

Re: [PATCH v3 2/2] powerpc: add support for csum_add()

2015-05-26 Thread Scott Wood
On Tue, 2015-05-26 at 13:57 +, David Laight wrote: > From: Scott Wood ... > > > I'd also have thought that the 64bit C version above would be > > > generally 'good'. > > > > It doesn't generate the addc/addze sequence. At least with GCC > > 4.8.2, > > it does something like: > > > > mr

RE: [PATCH v3 2/2] powerpc: add support for csum_add()

2015-05-26 Thread David Laight
From: Scott Wood ... > > I'd also have thought that the 64bit C version above would be generally > > 'good'. > > It doesn't generate the addc/addze sequence. At least with GCC 4.8.2, > it does something like: > > mr tmp0, csum > li tmp1, 0 > li tmp2, 0 > a

Re: [PATCH v3 2/2] powerpc: add support for csum_add()

2015-05-22 Thread Segher Boessenkool
On Fri, May 22, 2015 at 02:32:42PM -0500, Scott Wood wrote: > > I'd also have thought that the 64bit C version above would be generally > > 'good'. > > It doesn't generate the addc/addze sequence. At least with GCC 4.8.2, > it does something like: > > mr tmp0, csum > li tm

Re: [PATCH v3 2/2] powerpc: add support for csum_add()

2015-05-22 Thread Scott Wood
On Fri, 2015-05-22 at 16:39 -0500, Segher Boessenkool wrote: > On Fri, May 22, 2015 at 02:32:42PM -0500, Scott Wood wrote: > > > I'd also have thought that the 64bit C version above would be generally > > > 'good'. > > > > It doesn't generate the addc/addze sequence. At least with GCC 4.8.2, > >

Re: [PATCH v3 2/2] powerpc: add support for csum_add()

2015-05-22 Thread Scott Wood
On Fri, 2015-05-22 at 15:57 +, David Laight wrote: > From: Linuxppc-dev Christophe Leroy > > Sent: 19 May 2015 16:19 > ... > > diff --git a/arch/powerpc/include/asm/checksum.h > > b/arch/powerpc/include/asm/checksum.h > > index 5e43d2d..e8d9ef4 100644 > > --- a/arch/powerpc/include/asm/checksu

RE: [PATCH v3 2/2] powerpc: add support for csum_add()

2015-05-22 Thread David Laight
From: Linuxppc-dev Christophe Leroy > Sent: 19 May 2015 16:19 ... > diff --git a/arch/powerpc/include/asm/checksum.h > b/arch/powerpc/include/asm/checksum.h > index 5e43d2d..e8d9ef4 100644 > --- a/arch/powerpc/include/asm/checksum.h > +++ b/arch/powerpc/include/asm/checksum.h > @@ -130,6 +130,22 @

[PATCH v3 2/2] powerpc: add support for csum_add()

2015-05-19 Thread Christophe Leroy
The C version of csum_add() as defined in include/net/checksum.h gives the following assembly in ppc32: 0: 7c 04 1a 14 add r0,r4,r3 4: 7c 64 00 10 subfc r3,r4,r0 8: 7c 63 19 10 subfe r3,r3,r3 c: 7c 63 00 50 subfr3,r3,r0