Assembler Optimizer

Page 45/49
38 | 39 | 40 | 41 | 42 | 43 | 44 | | 46 | 47 | 48 | 49

By Grauw

Ascended (9915)

Grauw's picture

03-05-2021, 22:05

santiontanon wrote:

Oh, I misread your earlier comment about the 16bit signed shift! you can ignore Smile

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!

How do I write a < or > character? ;)

By santiontanon

Paragon (1420)

santiontanon's picture

03-05-2021, 22:59

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)

By Grauw

Ascended (9915)

Grauw's picture

03-05-2021, 23:03

It was just to check if we were paying attention, right.

By santiontanon

Paragon (1420)

santiontanon's picture

04-05-2021, 03:28

lol, exactly Wink

By santiontanon

Paragon (1420)

santiontanon's picture

07-05-2021, 06:05

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!)

By ToriHino

Paladin (710)

ToriHino's picture

07-05-2021, 06:56

Thanks for the update! Running it again over my sources Smile

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.

By santiontanon

Paragon (1420)

santiontanon's picture

07-05-2021, 15:20

Oh, good one! Thanks! Fixed in GitHub for the next version Smile

By Bengalack

Champion (393)

Bengalack's picture

07-05-2021, 21:44

More cool stuff Smile

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?

By santiontanon

Paragon (1420)

santiontanon's picture

07-05-2021, 22:19

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".

By santiontanon

Paragon (1420)

santiontanon's picture

07-05-2021, 23:29

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 Smile

Page 45/49
38 | 39 | 40 | 41 | 42 | 43 | 44 | | 46 | 47 | 48 | 49