Code Optimizer for Spin to Spin?
Oldbitcollector (Jeff)
Posts: 8,091
Is there a method of running BST's optimizer and having it return optimized spin code instead of just uploading it to the Propeller? (unused methods)
Thanks
OBC
Thanks
OBC
Comments
Nice idea, but I suspect No. My understanding of the optimiser is that it would know the data being pushed onto the stack is immediately popped from the stack in the next pseudo spin bytecode, so the push/pop may be removed. Brad of course will have to answer. It really depends on the level of optimisation he has done. My presumption is he has done a few tricks of regularly used routines. Because our source is not the spin bytecode is the reason I suspect the middle pass will not be available to output.
This does raise an interesting observation though. BST can do a listing, so the optimisations could actually be seen. But we are at spin bytecode which is a middle ground. Perhaps we could do a "middle ground" bytecode editor??? Not sure what that would entail at the moment, but a thought worthy of further investigation.
I would love to have time to investigate a new syntax for spin styled on basic more. A small runtime compiler based on sphinx would permit a small PropDos style computer
x = x * 5
y = y + 1
z = z + (x/y)
versus
z += (x *= 5) / (++y)