From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: Zack Weinberg Cc: Jamie Lokier , egcs@egcs.cygnus.com Subject: Re: gcc-2.7 creates faster code than pgcc-1.1.1 Date: Thu, 04 Mar 1999 18:09:00 -0000 Message-id: <13506.920599740@hurl.cygnus.com> In-reply-to: Your message of Thu, 04 Mar 1999 20:04:53 MST. < 199903050104.UAA15335@octiron.phys.columbia.edu > References: <199903050104.UAA15335@octiron.phys.columbia.edu> X-SW-Source: 1999-03/msg00198.html In message < 199903050104.UAA15335@octiron.phys.columbia.edu >you write: > 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. True, but I don't believe the loop optimizer is prepared to do that since it doesn't keep track of what bits are active vs what bits are inactive in a value. jeff From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: Zack Weinberg Cc: Jamie Lokier , egcs@egcs.cygnus.com Subject: Re: gcc-2.7 creates faster code than pgcc-1.1.1 Date: Wed, 31 Mar 1999 23:46:00 -0000 Message-ID: <13506.920599740@hurl.cygnus.com> References: <199903050104.UAA15335@octiron.phys.columbia.edu> X-SW-Source: 1999-03n/msg00199.html Message-ID: <19990331234600.OyBYaAMp-p03aMj78zV8W-tLkpLV7ibmeIHSqgDhF4w@z> In message < 199903050104.UAA15335@octiron.phys.columbia.edu >you write: > 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. True, but I don't believe the loop optimizer is prepared to do that since it doesn't keep track of what bits are active vs what bits are inactive in a value. jeff