RE: Dynamically choosing a register
Posted by
J J-6 on
Jul 26, 2007; 7:24pm
URL: https://forum.world.st/Dynamically-choosing-a-register-tp133493p133494.html
> From:
[hidden email]> Date: Thu, 26 Jul 2007 11:43:43 +0100
> To:
[hidden email]> Subject: RE: Dynamically choosing a register
>
>
> Do you mean for the cond to be evaluated at compile time in the
> following?
>
> (def store-to-register (reg val)
> (cond (reg)
> ((number-that-means-eax) (store eax val)
No, it can't be compile time since val will live in a field in instances of MethodContext. I can't know what val is until runtime. What I really want is a way to store in memory or another register some kind of reference to a register so that I would have the option in my VM that a caller can request the answer put right into the literal register of his choice.
> If so you could just generate:
> (mov t1 eax)
>
> Then the register allocator will try to allocate t1 in eax
> and remove that move.
>
> Bryce
Is there any documentation on your mid and low level code generator? I would like to make a lisp-like language that targets it. This way I wouldn't have to make a compiler for every processor type, but I would have full power of the CPU and no dependencies on C.
See what you’re getting into…before you go there.
Check it out!
_______________________________________________
Exupery mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery