[PR #3568] [MERGED] Core: Fix MXCSR and FPUCW registers on created threads #3579

Closed
opened 2026-02-27 22:04:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3568
Author: @StevenMiller123
Created: 9/10/2025
Status: Merged
Merged: 9/10/2025
Merged by: @squidbus

Base: mainHead: fix-regs


📝 Commits (6)

📊 Changes

1 file changed (+7 additions, -9 deletions)

View changed files

📝 src/core/thread.cpp (+7 -9)

📄 Description

Orbis seems to set the flush-to-zero and denormals-are-zero flags of MXCSR, unlike all other platforms, and defaults to a higher floating point precision than Windows.
This PR sets these registers using constants dumped from real hardware.

This fixes the currently Linux-specific crash in base versions of Uncharted 4: A Thief’s End™, as described in https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues/146

Let me know if there are any formatting changes I need to make here, I don't typically use inline assembly.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3568 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 9/10/2025 **Status:** ✅ Merged **Merged:** 9/10/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `fix-regs` --- ### 📝 Commits (6) - [`4edf8f4`](https://github.com/shadps4-emu/shadPS4/commit/4edf8f47cf1d183cb46800414cb905a619e990b4) Use _mm_setcsr over assembly - [`4df1108`](https://github.com/shadps4-emu/shadPS4/commit/4df1108c19474471ea0e4543df62b40df337741c) Clang - [`3e5c1e4`](https://github.com/shadps4-emu/shadPS4/commit/3e5c1e4db558f30ce419a014ab92bc8d722ef3b8) Missing include - [`f5e9366`](https://github.com/shadps4-emu/shadPS4/commit/f5e9366340a4785c2545ae9e327f2918313c16ff) Unconditionally set FPUCW - [`51e3e04`](https://github.com/shadps4-emu/shadPS4/commit/51e3e0475979e05124026d5cb8302c761ade87e1) Fix FPUCW and MXCSR registers on Windows - [`6af1ecc`](https://github.com/shadps4-emu/shadPS4/commit/6af1ecc30cf3a7f85b504f79a90abd721f4bcecf) Set MXCSR on all platforms ### 📊 Changes **1 file changed** (+7 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/core/thread.cpp` (+7 -9) </details> ### 📄 Description Orbis seems to set the flush-to-zero and denormals-are-zero flags of MXCSR, unlike all other platforms, and defaults to a higher floating point precision than Windows. This PR sets these registers using constants dumped from real hardware. This fixes the currently Linux-specific crash in base versions of Uncharted 4: A Thief’s End™, as described in https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues/146 Let me know if there are any formatting changes I need to make here, I don't typically use inline assembly. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:04:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3579
No description provided.