[U-Boot] [PATCH] crc32: Impl. linux optimized crc32()

Joakim Tjernlund joakim.tjernlund at transmode.se
Tue Nov 3 18:11:45 CET 2009


Wolfgang Denk <wd at denx.de> wrote on 03/11/2009 17:02:27:
>
> Dear Joakim Tjernlund,
>
> In message <1257263550-21504-1-git-send-email-Joakim.Tjernlund at transmode.se> you wrote:
> > Ported over the more efficient linux crc32() function.
> > A quick comparsion on ppc:
> > After changing the old crc32 to do 4 bytes in the
> > inner loop to be able to compare with new version one can note:
> > - old inner loop has 61 insn, new has 19 insn.
> > - new crc32 does one 32 bit load of data to crc while
> >   the old does four 8 bits loads.
> > - size is bit bigger for the new crc32:
> >   1392(old) 1428(new) of text. Can probably be shrunk
> >   somewhat by inlining crc32().
>
> The Purpose of Computing is Insight, Not Numbers.
>
> So how much faster does the new code run, on a real machine? How much
> time can be saved to mount a real JFFS2 file system, or to checksum a
> reall image file?

Picky I see. Like I said, numbers was done long time ago and isn't
available now, the effects on mount time in linux was real.

The best I am prepared to do is this(on mpc832x):
New
=> date;crc 0 0xfffffff;date
Date: 2009-11-03 (Tuesday)    Time: 17:00:55
CRC32 for 00000000 ... 0ffffffe ==> b2474c51
Date: 2009-11-03 (Tuesday)    Time: 17:01:34

->  39 secs

Old
=> date;crc 0 0xfffffff;date
Date: 2009-11-03 (Tuesday)    Time: 17:03:24
CRC32 for 00000000 ... 0ffffffe ==> 218bdca9
Date: 2009-11-03 (Tuesday)    Time: 17:04:24

->  60 secs

If this isn't enough, you can always hope someone else wants
to do further testing.

 Jocke



More information about the U-Boot mailing list