From: "Alexei A. Frounze" Newsgroups: comp.os.msdos.djgpp Subject: Re: inefficiency of GCC output code & -O problem Date: Fri, 14 Apr 2000 08:46:19 +0400 Organization: MTU-Intel ISP Lines: 41 Message-ID: <38F6A29B.3AAEC0E@mtu-net.ru> References: <38F20E7A DOT 3330E9A4 AT mtu-net DOT ru> <38F23A21 DOT A59621A1 AT inti DOT gov DOT ar> <38F49A45 DOT 13F0AB1 AT mtu-net DOT ru> <8d4ca1 DOT 3vvqqup DOT 0 AT buerssner-17104 DOT user DOT cis DOT dfn DOT de> <38F60DB3 DOT E355975 AT mtu-net DOT ru> <8d5ljq DOT 3vvqipv DOT 0 AT buerssner-17104 DOT user DOT cis DOT dfn DOT de> NNTP-Posting-Host: ppp98-33.dialup.mtu-net.ru Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-Trace: gavrilo.mtu.ru 955688451 1114 212.188.98.33 (14 Apr 2000 05:00:51 GMT) X-Complaints-To: usenet-abuse AT mtu DOT ru NNTP-Posting-Date: 14 Apr 2000 05:00:51 GMT X-Mailer: Mozilla 4.61 [en] (Win95; I) X-Accept-Language: en,ru To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Dieter Buerssner wrote: > > Alexei A. Frounze wrote: > > I have not said, that the plain C code would be faster or slower. > I just asked a question, that may be not to difficult to answer > for you, because the C code is already there, in comments. Not really. Actually, my ASM code improves the performance greatly. And I can't copmare ASM vs optimized plain C because GCC/AS doesn't compile the source with -O2 switch. > Not here. When compiling your code with gcc -O -S (gcc 2.95.2), > for the interesting lines > So, this happens to produce correct code, even if the inline > assembly is wrong, as I explained in another post. ... > If I use the C code, that is cited above, the output is > the following: > > movl -132(%ebp),%ebx > subl %edi,%ebx > movl -136(%ebp),%edx > subl %esi,%edx > sarl $4,%ebx > sarl $4,%edx > > So, which do you think is more efficient? :) But -O is not enough for me. ;) I still need -O2. thanks Alexei A. Frounze ----------------------------------------- Homepage: http://alexfru.chat.ru Mirror: http://members.xoom.com/alexfru