gcc-2.7 creates faster code than pgcc-1.1.1
Zack Weinberg
zack@rabi.columbia.edu
Thu Mar 4 17:05:00 GMT 1999
On Thu, 4 Mar 1999 22:20:18 +0100, Jamie Lokier wrote:
>> After several day of search I finally find out offending
>> instruction that slow down gzip compiled with egcs-1.1.1/pgcc-1.1.1
>> on PentiumPro 180MHz (132MB RAM) but the result seems crazy to me.
>>
>> This instruction is:
>> andl $255, %eax
>> in flush_window (util.c) function body (it is inlined from updcrc)
>>
>> if you manually replace it with
>> movzbl %al, $eax
>> this will boost decompression by 20%.
>
>In the past I have written hand-optimised assembly language, tuned for
>the different x86 families, and I found movzbl to be a very effective
>instruction on the Pentium Pro. So what you describe sounds correct.
>
>Another is to do xorl %eax,%eax just before loading something into %al.
>That is fast on the PPro too.
A related issue: I see us generate a lot of code like this for loops over
strings:
loop:
xorl %eax, %eax
movb (%esi), %al
incl %esi
movb %al, (%edi)
incl %edi
testl %eax
jne loop
After the first iteration, the xorl is unnecessary. We ought to be able to
hoist it out of the loop.
zw
More information about the Gcc
mailing list