Great progress, as usual.
I tested with SDCC-output. Same results as before. Most things work, but not "-ro", due to reused / local-scope symbols.
Mmmm, seems that the last beta still generates this:
ld hl, ?const ; +mdl
Thanks jltursan for the new example! Will be working on it this week!! It also contains examples of some sjasm syntax I had not yet implemented (e.g.: "::0"), which is neat!
I am surprised at the "?const" and the "-ro" issues though, I thought I had fixed both haha. But ok! I'll look into them later today! But first, let me double check that I didn't upload the wrong version by mistake (which is possible) hahaha
In any case, any small snippets showing the particular cases where these instances happened would be great help so I can create test cases! Thanks a lot again for testing!
I just wanted to say thanks for the work on the optimizer. I am running it now in my IDE and I love it!!!
Awesome!! Thanks for the kind words Huey!
New weekend, new release (while I have the energy to do it hahaha): https://github.com/santiontanon/mdlz80optimizer/releases/tag...
In this new 1.6 version I hope to have fixed all of the issues we discussed above, and also added some new functionalities (like the -asm+:html or -po-ldo flags, which have been very useful to me).
- @bengalack: I think I have found the issues with the reorganizer that were causing troubles in your case (a similar report by @salutte gave me a hint!). Or at least I hope! haha
- @jltursan: I managed to get both AGD tests you shared fully parse with MDL and optimizations are generated! I also verified that the resulting optimized code can be compiled with sjasm, and it works for me on sjasm v0.42c. The only thing I had to do is to protect that "push hl/pop hl" case with "; mdl:no-opt" comments in the source, and that's it!
In both cases, instead of "-po-apply" (which is deprecated), I use the new "-asm-dialect". So, for example, for the AGD test, I run it like this:
java -jar mdl.jar AGD/test02/test.asm -dialect sjasm -ro -po -asm-dialect AGD/test02/test-mdl.asm ./sjasm AGD/test02/test-mdl.asm
Of course, you can also ask MDL to generate the binaries directly, instead of calling sjasm, but I would trust sjasm better than MDL for now, until MDL is more "battle-tested" haha
Yep, understood, thanks!. As usual I'll get back to you ASAP
Very nice!
I don't have time right now to investigate exactly what happens, but it works!
java -jar mdl.jar Debug\objs\game.asm -dialect sdcc -ro -po speed -asm-dialect Debug\objs\game.asm.mdl.asm
Gives this:
INFO: PatternBasedOptimizer: 178 patterns applied, -62 bytes, 691 t-states saved. INFO: mdl optimization summary: -25 bytes, 906 t-states saved. CodeReorganizer moves: 17. Pattern-based optimizer pattern applications: 178.
A quick test of the running game afterwards tells me that runtime works too. Well done!!
Wohoo!!! Thanks both for all your help in testing this!
Slowly moving forward
I can confirm that it works on Edelweiss!
Also:
Slowly moving forward
slowly? progress is amazing!