Revert "Replace rotate utils with std::rotl" (partial)

This reverts commit 4d8bfe328b.
This commit is contained in:
Nekotekina 2020-04-14 19:41:31 +03:00
parent bc3b70c338
commit b1b67a13c6
9 changed files with 176 additions and 48 deletions

View file

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "Utilities/JIT.h"
#include "Utilities/asm.h"
#include "Utilities/sysinfo.h"
#include "Emu/Memory/vm_ptr.h"
#include "Emu/Memory/vm_reservation.h"
@ -1062,7 +1063,7 @@ std::string spu_thread::dump_misc() const
{
ret += '\n';
}
fmt::append(ret, "\nWaiting: %fs", (get_system_time() - _time) / 1000000.);
}
@ -1548,7 +1549,7 @@ void spu_thread::do_dma_transfer(const spu_mfc_cmd& args)
bool spu_thread::do_dma_check(const spu_mfc_cmd& args)
{
const u32 mask = std::rotl<u32>(1, args.tag);
const u32 mask = utils::rol32(1, args.tag);
if (mfc_barrier & mask || (args.cmd & (MFC_BARRIER_MASK | MFC_FENCE_MASK) && mfc_fence & mask)) [[unlikely]]
{
@ -1564,13 +1565,13 @@ bool spu_thread::do_dma_check(const spu_mfc_cmd& args)
if ((mfc_queue[i].cmd & ~0xc) == MFC_BARRIER_CMD)
{
mfc_barrier |= -1;
mfc_fence |= std::rotl<u32>(1, mfc_queue[i].tag);
mfc_fence |= utils::rol32(1, mfc_queue[i].tag);
continue;
}
if (true)
{
const u32 _mask = std::rotl<u32>(1u, mfc_queue[i].tag);
const u32 _mask = utils::rol32(1u, mfc_queue[i].tag);
// A command with barrier hard blocks that tag until it's been dealt with
if (mfc_queue[i].cmd & MFC_BARRIER_MASK)
@ -1671,14 +1672,14 @@ bool spu_thread::do_list_transfer(spu_mfc_cmd& args)
if (items[index].sb & 0x8000) [[unlikely]]
{
ch_stall_mask |= std::rotl<u32>(1, args.tag);
ch_stall_mask |= utils::rol32(1, args.tag);
if (!ch_stall_stat.get_count())
{
ch_event_stat |= SPU_EVENT_SN;
}
ch_stall_stat.set_value(std::rotl<u32>(1, args.tag) | ch_stall_stat.get_value());
ch_stall_stat.set_value(utils::rol32(1, args.tag) | ch_stall_stat.get_value());
args.tag |= 0x80; // Set stalled status
return false;
@ -1773,7 +1774,7 @@ void spu_thread::do_mfc(bool wait)
static_cast<void>(std::remove_if(mfc_queue + 0, mfc_queue + mfc_size, [&](spu_mfc_cmd& args)
{
// Select tag bit in the tag mask or the stall mask
const u32 mask = std::rotl<u32>(1, args.tag);
const u32 mask = utils::rol32(1, args.tag);
if ((args.cmd & ~0xc) == MFC_BARRIER_CMD)
{
@ -2130,7 +2131,7 @@ bool spu_thread::process_mfc_cmd()
}
case MFC_PUTQLLUC_CMD:
{
const u32 mask = std::rotl<u32>(1, ch_mfc_cmd.tag);
const u32 mask = utils::rol32(1, ch_mfc_cmd.tag);
if ((mfc_barrier | mfc_fence) & mask) [[unlikely]]
{
@ -2178,11 +2179,11 @@ bool spu_thread::process_mfc_cmd()
}
mfc_queue[mfc_size++] = ch_mfc_cmd;
mfc_fence |= std::rotl<u32>(1, ch_mfc_cmd.tag);
mfc_fence |= utils::rol32(1, ch_mfc_cmd.tag);
if (ch_mfc_cmd.cmd & MFC_BARRIER_MASK)
{
mfc_barrier |= std::rotl<u32>(1, ch_mfc_cmd.tag);
mfc_barrier |= utils::rol32(1, ch_mfc_cmd.tag);
}
return true;
@ -2214,11 +2215,11 @@ bool spu_thread::process_mfc_cmd()
}
mfc_size++;
mfc_fence |= std::rotl<u32>(1, cmd.tag);
mfc_fence |= utils::rol32(1, cmd.tag);
if (cmd.cmd & MFC_BARRIER_MASK)
{
mfc_barrier |= std::rotl<u32>(1, cmd.tag);
mfc_barrier |= utils::rol32(1, cmd.tag);
}
return true;
@ -2238,7 +2239,7 @@ bool spu_thread::process_mfc_cmd()
{
mfc_queue[mfc_size++] = ch_mfc_cmd;
mfc_barrier |= -1;
mfc_fence |= std::rotl<u32>(1, ch_mfc_cmd.tag);
mfc_fence |= utils::rol32(1, ch_mfc_cmd.tag);
}
return true;
@ -2838,7 +2839,7 @@ bool spu_thread::set_ch_value(u32 ch, u32 value)
case MFC_WrListStallAck:
{
// Reset stall status for specified tag
const u32 tag_mask = std::rotl<u32>(1, value);
const u32 tag_mask = utils::rol32(1, value);
if (ch_stall_mask & tag_mask)
{