Closed larsbrinkhoff closed 8 years ago
Possibly something for this PR, or maybe a separate one, but it would be helpful when reading and understanding the code if the yacht-block for each instruction is put in the code as a comment.
Here's another one: LEA
.
Maybe I should explain the many Fall through
comments.
The instruction state machines begin with calling ea_begin_read
. Then it goes directly into the next state, which waits for the EA calculation to finish. But this state may exit immediately, because the register addressing modes do not add any cycles to the instruction time.
Yes, I was thinking maybe the case sections should be reordered, so that the actual fall-through occurs at the end of the case, and the path that breaks is above.
Also, I think I'd rather see {} around single line statements in if/else's too. They make things a bit more consistent, and they also make it easier when inserting the generic debug code.
Like that?
Yes, like that.
I added a cpu_prefetch
to the last instruction, LEA
. Seemlingly without any ill effects.
cpu_prefetch
should be fine as long as it's only called once during the instruction execution. fetch_instr
will check the prefetch value and not do a new fetch. If cpu_prefetch
is called multiple times, the previous value will be lost. In reality it should propagate down through IRC/IR/IRD as you know.
Right. I was planning to some prefetch work in another branch, so I wasn't too careful with that here.
Make the existing
CMP
use the EA state machine.Add state machines for
NEG
,NEG
, andNEGX
.Tested with Desktop, Phalanx Demo, BIG Demo.