mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-28 22:29:36 +00:00
Corrects MULU timing.
This commit is contained in:
parent
255f0d4b2a
commit
d8fb6fb951
@ -930,12 +930,12 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
|
|||||||
int number_of_ones = 0;
|
int number_of_ones = 0;
|
||||||
auto source = active_program_->source->halves.low.full;
|
auto source = active_program_->source->halves.low.full;
|
||||||
while(source) {
|
while(source) {
|
||||||
|
number_of_ones += source&1;
|
||||||
source >>= 1;
|
source >>= 1;
|
||||||
++number_of_ones;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Time taken = 38 cycles + 2 cycles per 1 in the source.
|
// 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;
|
} break;
|
||||||
|
|
||||||
case Operation::MULS: {
|
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;
|
int source = active_program_->source->halves.low.full;
|
||||||
source = (source ^ (source << 1)) & 0xffff;
|
source = (source ^ (source << 1)) & 0xffff;
|
||||||
while(source) {
|
while(source) {
|
||||||
if(source&1) ++number_of_pairs;
|
number_of_pairs += source&1;
|
||||||
source >>= 1;
|
source >>= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user