6 ms·
Sure. Note that I picked those examples to demonstrate the two fairly quirky classes of things the optimizer tends to find. If the programmer has different requ
by Aransentin 5mo ago
Sure. Note that I picked those examples to demonstrate the two fairly quirky classes of things the optimizer tends to find. If the programmer has different requirements they can specify that, and it'll spit out the examples you gave (or something equivalent).
- HarHarVeryFunny 5mo agoI like the idea of exhaustive search, which the simplicity of the 6502 seems ideally suited for, but the search speed seems a bit limiting. I wonder if there's not potential for more generation restriction (e.g. code can only use a specific N bytes of zero page) and heavy search pruning to speed it up? If it could generate optimal 20-30 op sequences in semi-reasonable time that'd make it very useful.
- Aransentin 5mo agoHaving it only use operations that use a specific set of zero-page addresses is already supported, yep! 20-30 ops is probably impossible, unfortunately. The combinatorial explosion is just too enormous.
- peterfirefly 5mo agoe-graphs have been repeatedly reinvented across decades for many purposes. One of them is superoptimization. https://en.wikipedia.org/wiki/E-graph https://en.wikipedia.org/wiki/E-graph https://www.cs.cornell.edu/courses/cs6120/2025sp/blog/superopt/ https://www.cs.cornell.edu/courses/cs6120/2025sp/blog/supero... https://github.com/philzook58/awesome-egraphs https://github.com/philzook58/awesome-egraphs