www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/10/12/05:38:23

From: cnc AT netcom DOT com (Christopher Christensen)
Date: Tue, 11 Oct 1994 23:45:05 PDT
To: djgpp AT sun DOT soe DOT clarkson DOT edu, eliz AT is DOT elta DOT co DOT il
Subject: Re: 32/16bit?

>With all due respect to counting clock cycles, you forget the prefetch
>and decode queues of the processor, which all but annihilate that extra
>clock cycle (except for the very first instruction each time the queues
>are flushed, which shouldn't happen too often).

I am skeptical.  Could you point to a source (preferrably in the Intel
literature) that confirms this?  In the Intel Pentium Processor User's
Manual, in the section on optimization (section 24-4 if memory serves),
it specifically says to avoid instructions that require the operand size
prefix and it strongly implies that the operand size prefix costs you an
extra 1 clock on every instruction that uses it.  It is one of the first
few optimizations that they recommend (the 4th).  My understanding has
been that these prefix bytes (operand size, segment override, address size,
etc) are essentially treated as separate instructions by the CPU.  In fact,
in another Intel reference manual (the i486 databook) the various prefixes
are listed in the instruction summary along with all the normal instructions
and they are each listed as requiring 1 clock cycle.  If you check the long
list of assumptions that apply to those clock counts in the instruction
summary (optimal memory system, cache hits all the way, prefetch queue full,
no I/O during cache line fills, no address generation interlocks, no pipeline
stalls, no TLB misses etc) I think you'll find that the clock counts are
really BEST CASE scenarios.  Intel seems to be saying that these prefixes
take 1 clock best case whereas you are saying they are 0 clocks best case.
I would really like to know one way or the other.  The Intel literature
I've read seems pretty clear, but if you (or anyone) know of a better/clearer
source on the matter, please let me know.  In the meantime, I'll write a
quick little benchmark--that seems like the best way to resolve the matter.

cheers,
Christopher


-- 
----------------------------------------------------------------------
:  Christopher  :  Huntington Beach California, USA                  :
:  Christensen  :  email:  cnc AT netcom DOT com                            :
----------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019