cardinal-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cardinal-dev] Parrot IR compiler


From: Erik Bågfors
Subject: Re: [Cardinal-dev] Parrot IR compiler
Date: 30 May 2002 11:53:37 +0200

On Wed, 2002-05-29 at 06:52, Melvin Smith wrote:
> Hi guys,
> 
> Dan rubbed off on me, so I decided to subscribe here.
> Thanks for having me. :)

Welcome!

 
> I think you guys have some good input to give on stuff I'm working
> on. So to get right to the point, I'm working on the intermediate
> compiler for Parrot, and I'd like to hear what Ruby might need.
> 
> So far, all the compiler does (besides translating the IR to pasm) is
> register allocation. If any of you have Muchnicks book, I like
> his MIR language, which I'm taking a few things from.
> 
> Presently you can write code with unlimited symbolics or named
> locals and imcc will translate:
> 
> {
> .local int i
> i = 0
> $I0 = i + 5
> $I1 = $I0 * 2
> $I2 = $I1 * $I0
> i = $I2
> $I3 = $I0 + 1
> $I4 = $I0
> $I5 = $I4
> }
> 
> To:
> 
> set I3, 0
> add I0, I3, 5
> mul I1, I0, 2
> mul I2, I1, I0
> set I3, I2
> add I1, I0, 1
> set I1, I0
> set I0, I1
> 
> I expect the IR compiler to focus on staying clear, simple and maintainable,
> and never develop featuritis, however I want it to be adequate for all 
> languages
> targetting parrot.


Do I understand this correctly?  What does this IR language do?  Does it
only take care of register allocations?  Will it do more soon? If so
what?  Does it take care of variables on the stack if we run out of
registers? If it could take care of saving registers when doing
sub-calls that would help alot too.

I really could use a small language like this for my small
basic-compiler (which I will release soon.. somehow).  As register
allocations is really stupid in my compiler now (It only allows usage of
as many variables as there are registers currently)

/Erik

-- 
Erik Bågfors               | address@hidden
Supporter of free software | GSM +46 733 279 273
fingerprint: 6666 A85B 95D3 D26B 296B 6C60 4F32 2C0B 693D 6E32



reply via email to

[Prev in Thread] Current Thread [Next in Thread]