diff options
| author | ubiquitarianism <283527159+ubiquitarianism@users.noreply.github.com> | 2026-11-23 19:42:33 -0500 |
|---|---|---|
| committer | ubiquitarianism <283527159+ubiquitarianism@users.noreply.github.com> | 2026-11-23 19:42:33 -0500 |
| commit | 6dece923175bf349236d6aa21d383339848088fe (patch) | |
| tree | f32b02f25e21ed612db529979f45df80f935fddd /runtime/src/main.cpp | |
| parent | 8eee35cfdccc613a1f7a10a5539d5bd3b25038ba (diff) | |
| parent | d2d9b26572b7b7d73d2423296f69fac99b0f562f (diff) | |
Merge TreXito's unmerged PRs: translator fixes, fuzzers, CPU emulation, xapu/chad shims
Merged from the TreXito/mangrove copy of the original repository, which carried
contributor pull requests that were never merged here.
Kept: rdna2spirv fixes (ds_append/ds_consume, v_ldexp_f16 under MODE.FP_ROUND,
thread-group SGPR, fma exact), the differential fuzzers (dot, vint, wint, vrel, cvt,
f16misc, salu, mode) with their tests, the exe/import fail-fast and int3 cause tools,
Zen 2 instruction emulation (cpu_emulation.h) and the xapu.dll/chad.dll shims.
Not taken, because they conflict with different implementations already on main:
the D3D12 Xbox-ABI layer, xmem, acphal, loader TLS, f64_diff, DirectStorage (needs the
typed-error zlib inflate), and the copy's own MANGROVE.md and README changes.
Diffstat (limited to 'runtime/src/main.cpp')
| -rw-r--r-- | runtime/src/main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index fbb4b3043..098a8ee40 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | #include "base_reservation.h" | 30 | #include "base_reservation.h" |
| 31 | #include "code_hooks.h" | 31 | #include "code_hooks.h" |
| 32 | #include "cpu_emulation.h" | ||
| 32 | #include "host_cpu.h" | 33 | #include "host_cpu.h" |
| 33 | #include "mods.h" | 34 | #include "mods.h" |
| 34 | #include "pe_loader.h" | 35 | #include "pe_loader.h" |
| @@ -172,6 +173,15 @@ int wmain(int argc, wchar_t** argv) { | |||
| 172 | : "error: cannot create the trace file\n"); | 173 | : "error: cannot create the trace file\n"); |
| 173 | return 2; | 174 | return 2; |
| 174 | } | 175 | } |
| 176 | // The console's Zen 2 instructions this CPU may lack (docs/cpu_features.md): emulated on #UD. Installed after the | ||
| 177 | // trace's handler so it runs first, and an emulated instruction is not recorded as an exception. | ||
| 178 | if (const auto host = rt::cpu_emulation::detect_host(); !host.sse4a || !host.clzero || !host.monitorx || !host.clwb) | ||
| 179 | std::fprintf(stderr, "[rt] cpu: this CPU lacks%s%s%s%s; the game's uses are emulated (docs/cpu_features.md)\n", | ||
| 180 | host.sse4a ? "" : " SSE4a", host.clzero ? "" : " CLZERO", host.monitorx ? "" : " MONITORX", | ||
| 181 | host.clwb ? "" : " CLWB"); | ||
| 182 | if (!rt::cpu_emulation::install()) | ||
| 183 | std::fprintf(stderr, "[rt] cpu: AddVectoredExceptionHandler failed (error %lu); instructions this CPU lacks " | ||
| 184 | "will stop the game\n", GetLastError()); | ||
| 175 | 185 | ||
| 176 | try { | 186 | try { |
| 177 | rt::Loader loader(game_dir); | 187 | rt::Loader loader(game_dir); |