[clug] assembly performance

David Gibson david at gibson.dropbear.id.au
Fri Jun 10 03:34:10 GMT 2005


On Fri, Jun 10, 2005 at 01:13:22PM +1000, Adrian Blake wrote:
> Martin Pool wrote:
> >On  8 Jun 2005, Adrian Blake <A.Blake at physics.usyd.edu.au> wrote:
> >
> >>This is a question about microprocessor architecture.
> >>
> >>10 or 20 years ago assembly code addressed physical hardware, registers 
> >>ALUs and alike with an underlying simple microcode.
> >>
> >>This has changed. but to what extent?
> >>
> >>Does assembly code still operate on the physical hardware or is it  a 
> >>virtual machine with one or more layers of microcode? 
> >
> >
> >I think any modern large processor has some degree of microcoding.
> >Whether that makes it a virtual machine or not rather depends on which
> >definition you choose to use.
> 
> In assembly code on the modern micros are we addressing and manipulating 
> the silicon or just talking to a virtual processor ?

As Martin implies, that's not really a clear distinction.

> >>What are the performance penalties if any?
> >
> >
> >Penalties compared to what?  One could presumably always make chips
> >faster by adding more gates and/or spending more time on low-level
> >design rather than using microcode, but at what price?
> >
> If assembly code operates the silicon the performance is dependent upon 
> the skills of the assembly coder. But if the assembly code is 
> interpreted by a lower level code that simulates a virtual machine then 
> the performance can vary and the user is at the mercy of the microcoder.

This is a meaningless distinction.  The CPU goes as fast as it goes,
silicon and microcode combined.  There's no reason to expect
microcoders to do a worse job than the hardware designers.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/people/dgibson


More information about the linux mailing list