[Zlib-devel] infnew-5 available for testing

Chris Anderson christop at fellspt.charm.net
Fri Jan 10 19:09:00 EST 2003


On Fri, 10 Jan 2003, Chris Anderson wrote:

>
> Looks like gcc does something simular, but doesn't have the -2
> instructions with POSTINC:
>
> gcc3.2 -O3 -DPOSTINC (15 instructions)
>
> .L46:
>         movb    (%edx), %cl
>         movb    %cl, (%edi)
>         incl    %edx
>         movb    (%edx), %cl
>         incl    %edi
>         movb    %cl, (%edi)
>         incl    %edx
>         incl    %edi
>         movb    (%edx), %cl
>         movb    %cl, (%edi)
>         subl    $3, -64(%ebp)
>         incl    %edx
>         incl    %edi
>         cmpl    $2, -64(%ebp)
>         ja      .L46
>
> But, the times are better with POSTINC!
>
> gcc3.2 -O3 -DPOSTINC
> zbuflen  16384, clock 11.940, time 12.481
> zbuflen  16384, clock 12.020, time 12.592
>

I modified gcc's asm to put the len counter in register and to use addl
instructions instead of incl, like icc:

.L46:
        movb    (%edx), %cl
        subl    $3, %eax
        movb    %cl, (%edi)
        movb    1(%edx), %cl
        movb    %cl, 1(%edi)
        movb    2(%edx), %cl
        addl    $3, %edx
        movb    %cl, 2(%edi)
        addl    $3, %edi
        cmpl    $2, %eax
        ja      .L46

This buys me about .4 secs:

zbuflen  16384, clock 11.500, time 12.095
zbuflen  16384, clock 11.550, time 12.202










More information about the Zlib-devel mailing list