mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 07:46:01 +03:00
[PR #638] [MERGED] Add patches for F16C instructions under Rosetta 2. #1685
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#1685
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/638
Author: @squidbus
Created: 8/29/2024
Status: ✅ Merged
Merged: 8/30/2024
Merged by: @georgemoralis
Base:
main← Head:f16c📝 Commits (1)
a171509Add patches for F16C instructions under Rosetta 2.📊 Changes
8 files changed (+291 additions, -36 deletions)
View changed files
📝
.gitmodules(+4 -1)📝
CMakeLists.txt(+3 -0)📝
externals/CMakeLists.txt(+11 -5)➕
externals/half(+1 -0)📝
src/core/cpu_patches.cpp(+259 -30)📝
src/core/cpu_patches.h(+6 -0)📝
src/core/libraries/kernel/thread_management.cpp(+3 -0)📝
src/core/linker.cpp(+4 -0)📄 Description
Adds patches for F16C instructions which are currently missing under Rosetta 2 on macOS.
This also enhances the stack saving capabilities in the patcher to allow saving entire contexts with fewer TLS slots. Before the patcher would allocate a TLS slot for each register it needed to save. Now, it only needs two slots for an arbitrary amount of context: one slot for a thread-specific patch stack and the other for the original function stack. When a patch needs to save context it can switch out the stacks and save registers, then do the reverse when done.
Additionally some code is added for using vector and immediate operands in patches.
I tested this with CUSA16429 which is the only game I have that uses these instructions. From basic debugging examining the inputs and outputs it seems to work as expected although the game still does not progress past a black screen on launch so I can't validate it in-depth. It gets a lot further a long though until it hits a missing primitive type.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.