diff --git a/Utilities/JIT.cpp b/Utilities/JIT.cpp index c2e26bcbb3..0c5653fe6b 100644 --- a/Utilities/JIT.cpp +++ b/Utilities/JIT.cpp @@ -246,8 +246,9 @@ static void dummy() { } -jit_compiler::jit_compiler(std::unordered_map init_linkage_info) +jit_compiler::jit_compiler(std::unordered_map init_linkage_info, std::string _cpu) : m_link(std::move(init_linkage_info)) + , m_cpu(std::move(_cpu)) { #ifdef _MSC_VER m_link.emplace("__chkstk", (u64)&dummy); @@ -259,7 +260,11 @@ jit_compiler::jit_compiler(std::unordered_map init_ llvm::InitializeNativeTarget(); llvm::InitializeNativeTargetAsmPrinter(); LLVMLinkInMCJIT(); - m_cpu = llvm::sys::getHostCPUName(); + + if (m_cpu.empty()) + { + m_cpu = llvm::sys::getHostCPUName(); + } if (m_cpu == "skylake") { diff --git a/Utilities/JIT.h b/Utilities/JIT.h index f9e7c2f499..703b21491e 100644 --- a/Utilities/JIT.h +++ b/Utilities/JIT.h @@ -41,7 +41,7 @@ class jit_compiler final void init(); public: - jit_compiler(std::unordered_map); + jit_compiler(std::unordered_map, std::string _cpu); ~jit_compiler(); // Compile module diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index e51781480c..5aab71f230 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -94,6 +94,8 @@ cfg::map_entry g_cfg_ppu_decoder(cfg::root.core, "PPU Decoder" cfg::bool_entry g_cfg_llvm_logs(cfg::root.core, "Save LLVM logs"); +cfg::string_entry g_cfg_llvm_cpu(cfg::root.core, "Use LLVM CPU"); + const ppu_decoder s_ppu_interpreter_precise; const ppu_decoder s_ppu_interpreter_fast; @@ -928,7 +930,7 @@ extern void ppu_initialize(const ppu_module& info) } } - const auto jit = fxm::make(std::move(link_table)); + const auto jit = fxm::make(std::move(link_table), g_cfg_llvm_cpu.get()); LOG_SUCCESS(PPU, "LLVM: JIT initialized (%s)", jit->cpu()); }