From: sime AT fly DOT cc DOT fer DOT hr (S. Mikecin) Newsgroups: comp.os.msdos.djgpp Subject: Re: [Q] Which is faster? Date: 19 Oct 1997 17:20:12 GMT Organization: FER, Croatia Lines: 32 Distribution: world Message-ID: <62dfgc$n72@bagan.srce.hr> References: <628kkv$16c AT usenet DOT kreonet DOT re DOT kr> <34482426 DOT 74D1 AT drao DOT nrc DOT ca> Reply-To: sime AT fly DOT cc DOT etf DOT hr NNTP-Posting-Host: fly.cc.etf.hr Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk tom burgess (tburgess AT drao DOT nrc DOT ca) wrote: : good AT soback DOT kornet DOT nm DOT kr wrote: : > : > I have a question in DJGPP inline assembly. : > Among MOVW %AX, %BX, MOVL %EAX, %EBX : > : > This is just about speed, not others. : > : > Thanks in advance. : On 386 and 486, same speed. On Pentium, 16 bit operations (MOVW) are ^^^^^^^^^^^^^^^^^^^^^^^^^^ Not true! : SLOWER. (1 cycle prefix byte penalty, plus additional penalties : because instruction pairing is disabled) Before all, I have to say that on 386/486/Pentium in 32-bit protected mode movw is slower than movl cause of the prefix byte (so, not just on pentiums as you said). It is true that slowdown on pentiums is even more, cause of the instruction pairing. But even 386 and 486 suffer from it cause of that prefix byte! Conclusion would be, to avoid 16-bit operations (short in C). I've noticed that even replacing int type variables to be char type, makes a little speed up (at least on 486), when not using them as indexes of arrays. In this case speedup comes cause the compiler has more (parts of) registers available for it's own use. -- // E-mail: smikecin AT bigfoot DOT com // URL: http://fly.cc.fer.hr/~sime