1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Corrects MULU timing.

This commit is contained in:
Thomas Harte 2019-06-30 22:40:10 -04:00
parent 255f0d4b2a
commit d8fb6fb951

View File

@ -930,12 +930,12 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
int number_of_ones = 0;
auto source = active_program_->source->halves.low.full;
while(source) {
number_of_ones += source&1;
source >>= 1;
++number_of_ones;
}
// Time taken = 38 cycles + 2 cycles per 1 in the source.
set_next_microcycle_length(HalfCycles(4 * number_of_ones + 38*2));
set_next_microcycle_length(HalfCycles(4 * number_of_ones + 34*2));
} break;
case Operation::MULS: {
@ -952,7 +952,7 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
int source = active_program_->source->halves.low.full;
source = (source ^ (source << 1)) & 0xffff;
while(source) {
if(source&1) ++number_of_pairs;
number_of_pairs += source&1;
source >>= 1;
}