[stella] 6502 superoptimizer update

Subject: [stella] 6502 superoptimizer update
From: "Fred Quimby" <c9r@xxxxxxxxxxx>
Date: Tue, 31 May 2005 07:44:57 -0400
I found an amazing number of bugs in the first version of this I posted last 
week, and some of them were so bad that the program produced bogus results 
or overlooked results that should have been good.  I've attached the updated 
version (Alpha 0.02) to this post.

Bugs fixed:
The program did not set N and Z flags based on initial accumulator value
Carry flag was inverted in compare operations
Branches often jumped to wrong target address
Various other errors in 6502 core
The "Estimated time" is severely underestimated (actually, it's still not 
particularly accurate)

New feature:
Still one unbounded immediate, but also up to two bounded immedates allowed 
($00, $01, or $FF, which are probably the most common immediate values 
loaded.)

To do for next version:
Optimize code for speed!
Skip tests that rely on undefined flags
Skip tests that rely on undefined zero-page loads
Skip tests that store undefined register values
Stop if it is determined that the input code can be optimized
Post the source
Use something other than the gets() function to get stdin
Add command-line switches to specify:
- number of unbounded immediates allowed
- number of bounded immediates
- number of zero-page addresses
- Option to limit to a subset of the available instructions (legal opcodes, 
common opcodes, etc)

Any other suggestions/comments/criticism?

Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://stella.biglist.com

[demime 1.01d removed an attachment of type application/x-zip which had a name of 6502SOa2.zip]

Current Thread