Author: Dann Corbit
Date: 20:08:22 11/01/99
Go up one level in this thread
On November 01, 1999 at 22:49:44, Nicolas Carrasco wrote: >The solution to your problem is to build a better C compiler that is possible. That is always a good idea. For some kinds of problems, a different compiler will make monumental strides. An example is the legendary KAP preprocessor for multiple CPU systems. It often makes code run much faster. >That is the best option. It is rarely the best option. The reason is that compilers simply cannot do some things that a programmer can. For instance, you may know that some temporary can be reused and it is still sitting in a register. Or you may be able to schedule for the pipeline for an exact CPU, whereas the compiler may be forced to assume some sub-optimal instruction set that works across many compilers. Consider the MMX chips. I don't have any compiler that will target them. Too bad, since you could get a big boost if they were MMX aware. >Anyone agree me? There are three big problems with assembly language: 0. Tedious. One thousand lines of C may translate to ten thousand lines of assembly. It is hard to write optimal code if you have one million lines to write. 1. Non-portable. An enormous effort that targets a single architecture. Suppose that Alpha or ELBRUS or that new Mac chip or something else goes wild? You will have to start from scratch. And if you want to go to some contest wouldn't you want the fastest possible chip? Or maybe some machine with multiple CPU's could get an immediate port using CILK or the like. 2. Becomes obsolete. I have not written a lot of assembly code lately. I used to write in it long ago. If I look at my old code, it is now useless. Things like MOV AX, DX should now be MOV EAX, EDX to take advantage of the new (err.. less ancient) chips. But there comes a time to write assembly. Further, compiler writers must be expert assembly language programmers for obvious reasons. So it will never just go away.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.