Implement prefetch_write() and prefetch_exec() wrappers

Do some refactoring to prefetch_read() in util/asm.hpp as well.
Make all these function constexpr because they are no-ops.
This commit is contained in:
Nekotekina 2020-11-24 08:18:31 +03:00
parent 5076da8f77
commit 43952e18e2
6 changed files with 57 additions and 23 deletions

View file

@ -869,7 +869,7 @@ bool cpu_thread::suspend_work::push(cpu_thread* _this) noexcept
{
if (cpu != _this)
{
_m_prefetchw(&cpu->state);
utils::prefetch_write(&cpu->state);
return true;
}
@ -946,13 +946,13 @@ bool cpu_thread::suspend_work::push(cpu_thread* _this) noexcept
{
for (u32 i = 0; i < work->prf_size; i++)
{
_m_prefetchw(work->prf_list[0]);
utils::prefetch_write(work->prf_list[0]);
}
}
cpu_counter::for_all_cpu(copy2, [&](cpu_thread* cpu)
{
_m_prefetchw(&cpu->state);
utils::prefetch_write(&cpu->state);
return true;
});