www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/01/12/02:41:50

Date: Thu, 12 Jan 1995 03:03:09 -0400 (AST)
From: Bill Davidson <bdavidson AT ra DOT isisnet DOT com>
Subject: Re: deadly optimization
To: Mat Hostetter <mat AT ardi DOT com>
Cc: "Grzegorz B. Mazur" <gbm AT ii DOT pw DOT edu DOT pl>, djgpp AT sun DOT soe DOT clarkson DOT edu


On Wed, 11 Jan 1995, Mat Hostetter wrote:

> I mostly agree; writing in assembly is *almost* always a lose.  It
snip...
> Exceptions should only be made for *exceptionally* time-critical inner
> loops for programs where performance matters, and even then I write C
In my limited experience, another exception is floating point code.  On 
my old 8088/8087 system, using Turbo C, I could speed up FP code by an 
order of magnitude by writing the '87 assembler rather than C.  The 
compiler did a lousy job of using the FP register stack, and C makes it 
difficult to hold intermediate results in FP regs where they belong.  
Still, I guess on 486's and Pentia the on-chip cache must make the memory 
write/read penalty less severe.
Any thoughts on djgpp floating point code generation and optimization?

> 
> However, by comparison, our dynamically compiling 68040 emulator is
> entirely written in C!  Many CPU emulators you see out there are
> written in assembly, but they use stupid algorithms which let them get
> beat by better emulators written in C.
That's the nub, isn't it?  Better algorithms always win...

Bill Davidson
bdavidson AT ra DOT isisnet DOT com

- Raw text -


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