lkml.org 
[lkml]   [2011]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] add slice by 8 algorithm to crc32.c
From
Date
Joakim Tjernlund/Transmode wrote on 2011/08/08 13:11:14:
>
> "George Spelvin" <linux@horizon.com> 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.

Actually, it does make a difference(must remember to save file before gcc :)
Hard to tell if its any better though. Strangle this impacted the inner loop as well,
it gained an extra addi.

Jocke



\
 
 \ /
  Last update: 2011-08-08 13:27    [W:1.113 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site