SPU TSX: implement Accurate PUTLLC option

Allow spurious PUTLLC failure if disabled (default).
This commit is contained in:
Nekotekina 2019-05-25 22:23:23 +03:00
parent b839cc9d5b
commit 71b71537a0
3 changed files with 12 additions and 7 deletions

View file

@ -133,7 +133,7 @@ namespace cfg
return m_value; return m_value;
} }
bool get() const const bool& get() const
{ {
return m_value; return m_value;
} }
@ -184,7 +184,7 @@ namespace cfg
return m_value; return m_value;
} }
T get() const const T& get() const
{ {
return m_value; return m_value;
} }
@ -247,7 +247,7 @@ namespace cfg
return m_value; return m_value;
} }
int_type get() const const int_type& get() const
{ {
return m_value; return m_value;
} }
@ -347,7 +347,7 @@ namespace cfg
{ {
} }
std::set<std::string> get_set() const const std::set<std::string>& get_set() const
{ {
return m_set; return m_set;
} }
@ -382,7 +382,7 @@ namespace cfg
{ {
} }
std::map<std::string, logs::level> get_map() const const std::map<std::string, logs::level>& get_map() const
{ {
return m_map; return m_map;
} }

View file

@ -467,8 +467,12 @@ const auto spu_putllc_tx = build_function_asm<u64(*)(u32 raddr, u64 rtime, const
c.mov(x86::rax, x86::qword_ptr(x86::rbx)); c.mov(x86::rax, x86::qword_ptr(x86::rbx));
c.and_(x86::rax, -128); c.and_(x86::rax, -128);
c.cmp(x86::rax, x86::r13); c.cmp(x86::rax, x86::r13);
c.je(retry); c.jne(fail);
//c.jmp(fail); c.cmp(x86::r12, 16);
c.jb(retry);
c.mov(x86::rax, imm_ptr(&g_cfg.core.spu_accurate_putllc.get()));
c.test(x86::byte_ptr(x86::rax), 1);
c.jnz(retry);
c.bind(fail); c.bind(fail);
build_transaction_abort(c, 0xff); build_transaction_abort(c, 0xff);

View file

@ -378,6 +378,7 @@ struct cfg_root : cfg::node
cfg::_enum<spu_block_size_type> spu_block_size{this, "SPU Block Size", spu_block_size_type::safe}; cfg::_enum<spu_block_size_type> spu_block_size{this, "SPU Block Size", spu_block_size_type::safe};
cfg::_bool spu_accurate_getllar{this, "Accurate GETLLAR", false}; cfg::_bool spu_accurate_getllar{this, "Accurate GETLLAR", false};
cfg::_bool spu_accurate_putlluc{this, "Accurate PUTLLUC", false}; cfg::_bool spu_accurate_putlluc{this, "Accurate PUTLLUC", false};
cfg::_bool spu_accurate_putllc{this, "Accurate PUTLLC", false};
cfg::_bool spu_verification{this, "SPU Verification", true}; // Should be enabled cfg::_bool spu_verification{this, "SPU Verification", true}; // Should be enabled
cfg::_bool spu_cache{this, "SPU Cache", true}; cfg::_bool spu_cache{this, "SPU Cache", true};
cfg::_enum<tsx_usage> enable_TSX{this, "Enable TSX", tsx_usage::enabled}; // Enable TSX. Forcing this on Haswell/Broadwell CPUs should be used carefully cfg::_enum<tsx_usage> enable_TSX{this, "Enable TSX", tsx_usage::enabled}; // Enable TSX. Forcing this on Haswell/Broadwell CPUs should be used carefully