Mail Archives: djgpp/1997/10/22/08:33:00
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
- Raw text -