1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Don't bother prepropulating for writes.

This commit is contained in:
Thomas Harte 2023-11-07 14:38:23 -05:00
parent 413e7b7de1
commit f608153c1a

View File

@ -302,7 +302,12 @@ struct Memory {
write_back_address_[1] = high_address;
tags[low_address] = tag;
tags[high_address] = tag;
write_back_value_ = memory[write_back_address_[0]] | (memory[write_back_address_[1]] << 8);
// Prepopulate only if this is a modify.
if constexpr (type == AccessType::ReadModifyWrite) {
write_back_value_ = memory[write_back_address_[0]] | (memory[write_back_address_[1]] << 8);
}
return write_back_value_;
} else {
return memory[low_address] | (memory[high_address] << 8);