Potential of a compiler that creates the executable at once

Walter Bright newshound2 at digitalmars.com
Sat Feb 12 07:13:15 UTC 2022


On 2/11/2022 6:52 AM, max haughton wrote:
> The object emission code in the backend is quite inefficient,

It's faster than any other compiler.

> it needs to be rewritten (it's horrible old code anyway)

I suppose that depends on what you're used to. The basic design is pretty simple 
- there's a code gen function for each expression node type. The optimizer uses 
standard data flow analysis math. There's a separate pass for register 
allocation, and one for scheduling.

The design was originally written for the 8086. It survived extension to 32 
bits, then 64 bits, then SIMD.

The complexity comes from the complexity of the x86 instruction set and the 
choice of instructions is very dependent on the shape of the expression trees.

The only thing it has really failed at is the x87, which everyone wants to leave 
behind anyway.



More information about the Digitalmars-d mailing list