Author: Robert Hyatt
Date: 17:09:20 07/19/02
Go up one level in this thread
On July 19, 2002 at 00:48:21, Russell Reagan wrote: >On July 18, 2002 at 20:04:46, Robert Hyatt wrote: > >>You really have to test. And then test again in a few months after your >>code is more complex and "register jams" or "register spills" become a >>problem.. > >Could you explain what these things are? Register jams and spills. A register jam is what happens when you start to run out of registers. You start to use more instructions than necessary because (a) you don't have enough registers and (b) you want to avoid memory accesses. A register spill is what happens next. You run out and now have to start writing registers to memory so that you can use them for other computations. That hurts even more as you will later have to re-read what you just wrote. > Also, to be >able to competently look at the ASM that is generated, how much do I need to >learn? Is it enough to look at it and think, "1 load from memory, 1 AND >operation, one test operation, totalling 3 operations, which is better than the >other approach which uses 4 operations."? Or do things get more complicated than >that? I think there are some things I'm not sure about. For example, does >dereferencing a pointer (pointer_to_something->field) "cost" anything? Where >could I learn these kinds of things? Am I better off just learning ASM >altogether? > >Russell That is a good first cut... remember that a memory reference is slower than executing a couple of hundred instructions. But that is just a first approximation, because there can be instruction conflicts that bog the pipeline down with wasted cycles too... But if you work on just minimizing memory accesses, you will generally be doing the right thing always. For the PC of course. For a machine like the cray, this changes drastically.
This page took 0.01 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.