|x86 register allocation firstname.lastname@example.org (1999-03-23)|
|Re: x86 register allocation email@example.com (1999-03-28)|
|Re: x86 register allocation firstname.lastname@example.org (Robert Sherry) (1999-03-28)|
|x86 register allocation email@example.com (Matt Postiff) (1999-03-28)|
|Re: x86 register allocation firstname.lastname@example.org (1999-03-28)|
|Re: x86 register allocation email@example.com (Sander Vesik) (1999-03-28)|
|Re: x86 register allocation firstname.lastname@example.org (Charles E. Bortle, Jr.) (1999-03-28)|
|From:||Robert Sherry <email@example.com>|
|Date:||28 Mar 1999 16:59:49 -0500|
Here are my thoughts on your question. I believe you are
correct in concluding that the register coloring idea will not work
well on this processor family. I would leave DX and AX as scratch
registers. This still leaves BX, CX , SI and DI for use.
My experience indicates to me that allocating registers on the
basic block level is the way to go. By a basic block on mean a section
of code with a single entry and single exit. You might want to
allocate BX and CX at the basic block level.
You did not mention the source language. Some languages have a
register key word in the language, which is an hint to the compiler
that this variable should be allocated to a fast register. If your
source language has such a feature you may want to allocate those
variables to SI and DI. You might also want to allocate SI and DI to
variable that are used the most throughout a single
subroutine/function. This can be done by simple counting the number of
times the variable is used/referenced in a function. This count can be
weighted for variables inside loops. One draw back is that your
compiler must either process the entire subroutine/function all at
once or be 2 passes. If this approach seems like to much work then you
could allocate SI and DI at the basic block level also.
I hope this helps.
> Can anyone give me a pointer to help me with x86 register allocation?
Return to the
Search the comp.compilers archives again.