[pypy-dev] CLI code generation

Antonio Cuni anto.cuni at gmail.com
Mon Mar 20 22:06:15 CET 2006

Hi Armin,

Armin Rigo wrote:
> Actually, my comment about this was guided by the fact that I didn't see
> how the existing flow graph model can represent stack operations...
> Antonio, did you have something more precise in mind?  A bunch of of
> operations that have often no argument and/or no return value, but
> implicitly operate on the stack, e.g. stack_int_mul(), stack_push(v),
> v=stack_pop()?

Yes, that was precisely what I though, but it seems a little untidy: as 
you pointed out I think the best way to handle stack machines is to 
transform SSI operations into a completely new list of stack based 
operation (or, equivalently, into a complex expression tree).

With this schema we could also easily handle other problems in the 
future: for example, we could also write a transformer for 
register-based machines that takes a list of SSI operations and produces 
a list of operations specifically tailored for that task.

Given this it each backend could choose the "instruction set" that fit 
best its needs, just as at the moment each backed can choose whether to 
use lltypesystem or ootypesystem.

Just my 2 euro-cents,

ciao Anto

More information about the Pypy-dev mailing list