Re: 8086 register allocation

gah4 <>
Mon, 10 May 2021 14:49:27 -0700 (PDT)

          From comp.compilers

Related articles
8086 register allocation (Alexei A. Frounze) (2021-05-09)
Re: 8086 register allocation (Fernando) (2021-05-10)
Re: 8086 register allocation (gah4) (2021-05-10)
Re: 8086 register allocation (Hans-Peter Diettrich) (2021-05-11)
Re: 8086 register allocation (gah4) (2021-05-10)
Re: 8086 register allocation (Thomas Koenig) (2021-05-11)
Re: 8086 register allocation (Hans-Peter Diettrich) (2021-05-11)
| List of all articles for this month |

From: gah4 <>
Newsgroups: comp.compilers
Date: Mon, 10 May 2021 14:49:27 -0700 (PDT)
Organization: Compilers Central
References: 21-05-005
Injection-Info:; posting-host=""; logging-data="32173"; mail-complaints-to=""
Keywords: code, registers
Posted-Date: 10 May 2021 18:12:50 EDT
In-Reply-To: 21-05-005

On Sunday, May 9, 2021 at 5:04:18 PM UTC-7, wrote:
> For the fun of it I've implemented a greedy bottom-up local register
> allocator for the intel 8086 CPU, which is known for its non-uniform
> use of registers in ALU instructions and memory operands
> (

Reminds me of what, as far as I know, is also an unsolved problem:
register allocation for the x87.

First the 8087 was designed not knowing if it should be a stack or
register machine, so stack registers are addressable. (Even though
the addresses keep changing.)

It was also designed to have a virtual stack, which would spill to memory
on overflow, and back on underflow. That sounds nice, but it seems that
no-one tried to write the interrupt routine before the hardware was built,
and that it actually isn't possible. It seems that it isn't possible to get some
of the state bits set, such that it all works like a seamless virtual stack.

The 80287 is the same processing logic with a different bus interface
(and separate clock). As well as I know, things were redesigned later,
but it seems that there still is no virtual stack.

There are description of some compilers that give up on compiling any
code that needs more than eight registers.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.