Mega-cleanup for atomic_t<> and named bit-sets bs_t<>

Remove "atomic operator" classes
Remove test, test_and_set, test_and_reset, test_and_complement global functions
Simplify atomic_t<> with constexpr if, remove some garbage
Redesign bs_t<> to use class, mark its methods constexpr
Implement atomic_bs_t<> for optimizations
Remove unused __bitwise_ops concept (should be in other header anyway)
Bitsets can now be tested via safe bool conversion
This commit is contained in:
Nekotekina 2018-09-02 20:22:35 +03:00
parent a6d06b2e20
commit 8abe6489ed
23 changed files with 604 additions and 1090 deletions

View file

@ -607,7 +607,7 @@ void ppu_thread::exec_task()
{
if (g_cfg.core.ppu_decoder == ppu_decoder_type::llvm)
{
while (!test(state, cpu_flag::ret + cpu_flag::exit + cpu_flag::stop + cpu_flag::dbg_global_stop))
while (!(state & (cpu_flag::ret + cpu_flag::exit + cpu_flag::stop + cpu_flag::dbg_global_stop)))
{
reinterpret_cast<ppu_function_t>(static_cast<std::uintptr_t>(ppu_ref(cia)))(*this);
}
@ -625,7 +625,7 @@ void ppu_thread::exec_task()
while (true)
{
if (UNLIKELY(test(state)))
if (UNLIKELY(state))
{
if (check_state()) return;
@ -678,7 +678,7 @@ void ppu_thread::exec_task()
func2 = func4;
func3 = func5;
if (UNLIKELY(test(state)))
if (UNLIKELY(state))
{
break;
}
@ -763,9 +763,9 @@ cmd64 ppu_thread::cmd_wait()
{
while (true)
{
if (UNLIKELY(test(state)))
if (UNLIKELY(state))
{
if (test(state, cpu_flag::stop + cpu_flag::exit))
if (state & (cpu_flag::stop + cpu_flag::exit))
{
return cmd64{};
}