Skip to content

Commit

Permalink
System: Check for SSE4.1 in early hardware checks
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Jul 2, 2024
1 parent 173a610 commit baab966
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit baab966

Please sign in to comment.