RE: [PATCH] add slice by 8 algorithm to crc32.c

From: Bob Pearson
Date: Mon Aug 08 2011 - 13:04:12 EST


Same for x86. The code for the pre and post cleanup loops are the same
there.

> -----Original Message-----
> From: Joakim Tjernlund [mailto:joakim.tjernlund@xxxxxxxxxxxx]
> Sent: Monday, August 08, 2011 6:11 AM
> To: George Spelvin
> Cc: akpm@xxxxxxxxxxxxxxxxxxxx; fzago@xxxxxxxxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; rpearson@xxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH] add slice by 8 algorithm to crc32.c
>
> "George Spelvin" <linux@xxxxxxxxxxx> wrote on 2011/08/08 12:52:01:
> >
> > > I prefer to keep the current code which (at the time) generated good
> code
> > > for at least ppc:
> > > /* Align it */
> > > if (unlikely((long)buf & 3 && len)) {
> > > do {
> > > DO_CRC(*buf++);
> > > } while ((--len) && ((long)buf)&3);
> > > }
> >
> > Ah, I was looking at fzago's initial patch; I hadn't realized you'd
> > tweaked it. That's pretty much what I was talking about.
> >
> > Would
> > if (unlikely((long)buf & 3) && len) {
> >
> > give the compiler better hints? len != 0 is awfully
> > likely, actually.
>
> Doesn't matter on ppc(gcc 4.4.4). The whole while loop is moved out of
line
> in both cases and the generated asm is identical.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/