Skip to content

Commit

Permalink
Qt: disable TSX in the config.yml if not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed May 18, 2020
1 parent 1fffffa commit 703841e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions rpcs3/Emu/system_config.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#include "stdafx.h"
#include "system_config.h"
#include "Utilities/StrUtil.h"
#include "Utilities/sysinfo.h"

cfg_root g_cfg;

bool cfg_root::node_core::has_rtm() const
{
return utils::has_rtm();
}

std::string cfg_root::node_vfs::get(const cfg::string& _cfg, const char* _def) const
{
auto [spath, sshared] = _cfg.get();
Expand Down
7 changes: 6 additions & 1 deletion rpcs3/Emu/system_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ struct cfg_root : cfg::node
{
struct node_core : cfg::node
{
private:
/** We don't wanna include the sysinfo header here */
bool has_rtm() const;

public:
static constexpr bool thread_scheduler_enabled_def =
#ifdef _WIN32
true;
Expand Down Expand Up @@ -42,7 +47,7 @@ struct cfg_root : cfg::node
cfg::_bool spu_verification{ this, "SPU Verification", true }; // Should be enabled
cfg::_bool spu_cache{ this, "SPU Cache", true };
cfg::_bool spu_prof{ this, "SPU Profiler", false };
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", has_rtm() ? tsx_usage::enabled : tsx_usage::disabled }; // Enable TSX. Forcing this on Haswell/Broadwell CPUs should be used carefully
cfg::_bool spu_accurate_xfloat{ this, "Accurate xfloat", false };
cfg::_bool spu_approx_xfloat{ this, "Approximate xfloat", true };
cfg::_bool llvm_accurate_dfma{ this, "LLVM Accurate DFMA", true }; // Enable accurate double-precision FMA for CPUs which do not support it natively
Expand Down
2 changes: 2 additions & 0 deletions rpcs3/rpcs3qt/settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
ui->enableTSX->setEnabled(false);
ui->enableTSX->addItem(tr("Not supported", "Enable TSX"));
SubscribeTooltip(ui->enableTSX, tr("Unfortunately your CPU model does not support this instruction set.", "Enable TSX"));

m_emu_settings->SetSetting(emu_settings_type::EnableTSX, fmt::format("%s", tsx_usage::disabled));
}

// PPU tool tips
Expand Down

0 comments on commit 703841e

Please sign in to comment.