sharpemu/tests/SharpEmu.Libs.Tests/Cpu
kuba ab0e77e5d6
[CPU] Emulate and rewrite SHA extension instructions on hosts without SHA (#909)
* [CPU] Emulate the SHA extensions when the host raises #UD

The PS5 CPU supports SHA1RNDS4/SHA1NEXTE/SHA1MSG1/SHA1MSG2 and
SHA256RNDS2/SHA256MSG1/SHA256MSG2, and titles use them without a CPUID
check. Rosetta 2 does not translate them, so Poppy Playtime (UE4) aborted
with SIGILL on sha1msg1 on Apple Silicon. Decode the faulting instruction
and compute it from the saved XMM registers, like the SSE4a fallback.

* [Loader] Rewrite SHA extension instructions at load time on hosts without SHA

A #UD trap per SHA instruction is far too slow for titles that hash large
files: Poppy Playtime took 300k traps and the stall watchdog stopped it.
The red-zone patcher now replaces each SHA instruction with general-register
code in its trampoline, keeping all other registers and the flags. The trap
handler stays as the fallback for sites that cannot be patched.
2026-09-26 14:20:08 +03:00
..
BmiInstructionEmulatorTests.cs cpu: emulate BMI1/BMI2/ABM instructions in software when the host lacks them (#249) 2026-07-16 16:38:27 +03:00
DirectExecutionBackendLlePreferenceTests.cs feat(hle): prefer loaded guest exports for selected registrations (#844) 2026-08-25 22:32:57 +02:00
Gen5NativeReturnSmokeTests.cs [CPU] Host RBX is restored from the saved host frame below 2026-09-23 14:46:17 +03:00
GuestContextTransferValidationTests.cs [CPU] Reject context transfers to unmapped guest addresses (#273) 2026-07-16 19:57:34 +03:00
GuestExceptionExecutorHandoffTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
GuestThreadBlockWaiterRepresentationTests.cs [CPU] Preserve blocked leaf import waiters (#350) 2026-07-18 02:59:13 +03:00
GuestThreadFlowProfileTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
ImportLoopGuardBoundaryTests.cs fix(import-guard): recognize polling progress boundaries (#895) 2026-09-21 19:56:05 +03:00
ImportTrampolineAbiTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
JitStubsTests.cs CPU: scan final TLS access pattern offset (#414) 2026-07-19 00:07:32 +03:00
LibcFileObjectRoutingTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
LibcNativeFormattingRoutingTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
MemcpyHleRoutingTests.cs Amd fix opcode nid filecache wave32 (#903) 2026-09-24 15:00:42 +03:00
NativeDiagnosticMemoryReadTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
NativeTlsPatchRangeTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
ReadyThreadDispatchTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
ShaInstructionEmulatorTests.cs [CPU] Emulate and rewrite SHA extension instructions on hosts without SHA (#909) 2026-09-26 14:20:08 +03:00
ShaInstructionRewriteTests.cs [CPU] Emulate and rewrite SHA extension instructions on hosts without SHA (#909) 2026-09-26 14:20:08 +03:00
Sse4aBitFieldEmulatorTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Sse4aPosixSignalRecoveryTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
Sse4aWindowsExceptionRecoveryTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
TlsLoadPatchBoundaryTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
WindowsCrashCaptureTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
WindowsDebuggerBreakTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
WindowsExceptionTrampolineTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
WindowsFaultFilterTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00
WindowsThreadContextCaptureTests.cs Alpha Rebuild Progress (#887) 2026-09-20 04:09:27 +03:00