From baab966b4e522fbc63e71766dd29b07f7c9ceeb9 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 2 Jul 2024 18:14:00 +1000 Subject: [PATCH] System: Check for SSE4.1 in early hardware checks --- src/core/system.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/system.cpp b/src/core/system.cpp index cb8318f34..72e8cfa90 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -283,6 +283,18 @@ static TinyString GetTimestampStringForFileName() bool System::Internal::PerformEarlyHardwareChecks(Error* error) { + // This shouldn't fail... if it does, just hope for the best. + cpuinfo_initialize(); + +#ifdef CPU_ARCH_X64 + if (!cpuinfo_has_x86_sse4_1()) + { + Error::SetStringFmt(error, "Your CPU does not support the SSE4.1 instruction set.\n" + "A CPU from 2008 or newer is required to run DuckStation."); + return false; + } +#endif + // Check page size. If it doesn't match, it is a fatal error. const size_t runtime_host_page_size = PlatformMisc::GetRuntimePageSize(); if (runtime_host_page_size == 0)