ControlCplusControlV / Scribe

Minimal Yul Transpilation to the Miden VM
GNU General Public License v3.0
51 stars 4 forks source link

One-time stack re-ordering step for repeat loops #51

Open ControlCplusControlV opened 1 year ago

ControlCplusControlV commented 1 year ago

One-time stack re-ordering step for repeat loops

For repeat loops, instead of re-ordering the stack afterwards to be like before, you can instead see what the stack is going to look like at the end of the loop, and order the stack accordingly before the loop.

Ex. if the stack is [a, b, c] before the repeat, and will be [b, a, c] after one loop, instead of going [b, a, c] -> [a, b, c] N times, you can go from [a, b, c] -> [b, a, c] once, before the loop.