mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 07:46:01 +03:00
[PR #943] [MERGED] Patch extrq #1843
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#1843
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/943
Author: @OFFTKP
Created: 9/16/2024
Status: ✅ Merged
Merged: 9/23/2024
Merged by: @georgemoralis
Base:
main← Head:pat📝 Commits (6)
9242ad4Use a singleton for instruction decodingb42034dUse singleton class75ce774PatchEXTRQ7037924Fixup signal context functions4978346Merge branch 'main' into pat2ac4992Update CMakeLists.txt📊 Changes
9 files changed (+371 additions, -67 deletions)
View changed files
📝
CMakeLists.txt(+4 -2)📝
src/common/decoder.cpp(+11 -6)📝
src/common/decoder.h(+8 -3)➕
src/common/signal_context.cpp(+92 -0)➕
src/common/signal_context.h(+18 -0)📝
src/core/cpu_patches.cpp(+216 -10)📝
src/core/signals.cpp(+15 -41)📝
src/core/signals.h(+4 -4)📝
src/video_core/page_manager.cpp(+3 -1)📄 Description
Patches EXTRQ (SSE4A instruction) on cpus that don't support it.
If the EXTRQ is less than 5 bytes (can be 4 bytes sometimes), it handles it directly in the illegal instruction handler and doesn't patch it because 5 bytes at least are needed for a relative jump (trampoline)
Another method for dealing with this would be copying the next instruction to run after the trampoline injected code to make more space for the relative jump. This would be faster but less safe (what happens if something jumps to the area you clobbered and replaced with a jump) (also tedious because displacements in rip relative memory access/jumps would need to be changed)
Thus this method of handling smaller than jmp near instructions is employed here
Infamous First Light seems to get further with this patch and it doesn't seem to cause performance issues due to the signal handler.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.