Oh, I misread your earlier comment about the 16bit signed shift! you can ignore
And about the "cp a", oh! good point! I have it lumped with "cp <register>" and in general it depends on both A and <register>, but that particular case needs to be fixed. Good catch! I'll modify my dependencies definition file to account for this!
ouch! thanks! hahaha, I always fall for the same mistake (and usually have to edit the post, but this time I Was in a rush and didn't re-read the posted version)
It was just to check if we were paying attention, right.
lol, exactly
And after lots of bug-fixing, here's the final 2.0 release: https://github.com/santiontanon/mdlz80optimizer/releases/tag...
There's a few improvements here and there (a bit more flexible search-based optimizer, a couple of extra SDCC patterns, etc.), but this was mostly bug-fixing from the previous 2.0 pre-releases. Latest specification on how to use the search-based optimizer here: https://github.com/santiontanon/mdlz80optimizer/blob/master/...
Of course, always happy to fix bugs/issues, but I might take a break now from development to think about next steps (I want to see what can I do now that I have the search-based optimizer out of all the different ideas many people have been bringing up!)
Thanks for the update! Running it again over my sources
I saw a typo in the output:
'to remove a call and a ret statements as Function is only caled once'
There should be no s behind statements and called instead of caled.
Oh, good one! Thanks! Fixed in GitHub for the next version
More cool stuff
First time I test the so-thingy today, so I'm probably doing something wrong. But, in the example, we find this:
allowed_ops: shift ld allow_ram_use = false allowed_registers: hl, a initial_state: HL = ??val goal_state: HL = ??val << 10
I just changed the '10' to '5', and using this: java -jar mdl.jar test.txt -so-time
, ends with this:
ERROR: No program that satisfied the specification was found. ERROR: Problem executing worker SearchBasedOptimizer ERROR: Could not fully execute some workers (error code 3).
What should I do to get passed this?
ah, yeah, that could happen. By default, MDL only looks for programs of up to 4 instructions long, so probably it just didn't find any.
In this case, I'd add "addition" to the allowed_ops (as I think a 5 shift might require additions), and add a line to increase the maximum number of instructions considered, e.g. "max_ops = 6".
also, that being said, I think the search-based optimizer is going to be less useful than I originally anticipated, and more of a toy to play with. It just takes too long to search for any reasonable size program if you enable sufficient instructions in the search space haha. But it's ok, I'll try to make it faster bit by bit over time, and also there might be some uses for it that I need to explore