early-access version 2585

This commit is contained in:
pineappleEA
2022-03-21 16:53:01 +01:00
parent dd6ea95c54
commit 9c48e94f2d
31 changed files with 1072 additions and 483 deletions

View File

@@ -1495,15 +1495,13 @@ typename BufferCache<P>::OverlapResult BufferCache<P>::ResolveOverlaps(VAddr cpu
overlap_ids.push_back(overlap_id);
overlap.Pick();
const VAddr overlap_cpu_addr = overlap.CpuAddr();
bool goes_left = false;
if (overlap_cpu_addr < begin) {
goes_left = true;
const bool expands_left = overlap_cpu_addr < begin;
if (expands_left) {
cpu_addr = begin = overlap_cpu_addr;
}
const VAddr overlap_end = overlap_cpu_addr + overlap.SizeBytes();
bool goes_right = false;
const bool expands_right = overlap_end > end;
if (overlap_end > end) {
goes_right = true;
end = overlap_end;
}
stream_score += overlap.StreamScore();
@@ -1511,11 +1509,11 @@ typename BufferCache<P>::OverlapResult BufferCache<P>::ResolveOverlaps(VAddr cpu
// When this memory region has been joined a bunch of times, we assume it's being used
// as a stream buffer. Increase the size to skip constantly recreating buffers.
has_stream_leap = true;
if (goes_right) {
if (expands_right) {
begin -= PAGE_SIZE * 256;
cpu_addr = begin;
}
if (goes_left) {
if (expands_left) {
end += PAGE_SIZE * 256;
}
}