Re: [PATCH 1/2] lzma support: decompression lib, initrd support

Christian Leber
2005-06-14T12:54:29Z

On Tue, Jun 14, 2005 at 01:39:15PM +0100, Paulo Marques wrote:
> >[...]
> >>+ for (pb = 0; prop0 >= (9 * 5); pb++, prop0 -= (9 * 5));
> >>+ for (lp = 0; prop0 >= 9; lp++, prop0 -= 9);
> >
> >Put the ";" on a line of its own.
> >
> >I'd have thought the above could be done arithmetically?
>
> I just tried a small test program to see the speed/code size difference
> to this code, which is the arithmetic equivalent:
>
> pb = prop0 / (9 * 5);
> prop0 %= (9 * 5);
> lp = prop0 / 9;
> prop0 %= 9;
>
> This code runs a lot faster than the original. This is not very
> important since it runs only once AFAICT.

Was allready fixed in the newer version.
But i doubt that this _few_ cycles matter in any way.

The odd thing is, that the orginal lzma author has both version in the
lastest version of his sdk, but commented out the arithmetic version ?!?

> As for the code size, it is smaller if compiled with -Os, but larger
> when compiled with -O2 or -O3.

-O3 helps a lot for the actual decompression

Christian Leber

--