Commit graph

126 commits

Author SHA1 Message Date
Megamouse
fe75311be2 move config structs to own files and clean up some headers 2020-02-17 15:08:17 +03:00
Nekotekina
4bc431ec31 Silence deprecation warning (implicit capture of this on [=]) 2020-02-10 14:47:12 +03:00
Nekotekina
c0f80cfe7a Use attributes for LIKELY/UNLIKELY
Remove LIKELY/UNLIKELY macro.
2020-02-05 10:42:34 +03:00
Nekotekina
6dfd97f0b6 Modernize SPU logging (spu_log variable) and remove log legacy
Remove legacy macro (LOG_ERROR, etc)
2020-02-01 11:52:52 +03:00
Nekotekina
185c067d5b C-style cast cleanup V 2019-12-03 17:23:00 +03:00
Nekotekina
1b9a3e6077 SPU: internal refactoring, add spu_program
Use struct (spu_program) instead of std::vector<u32>.
2019-11-26 00:01:38 +03:00
Eladash
a21d7def33 SPU: Don't break blocks on DSYNC instruction in Safe mode (#6731) 2019-11-11 23:12:21 +03:00
Nekotekina
5f00b32867 SPU: fixup for duplicates in recompilers
Fixup for the edge case.
2019-10-27 13:04:05 +03:00
Nekotekina
8c28c4e8ec SPU: Make recompilers lock-free. 2019-10-26 23:33:18 +03:00
Nekotekina
9ac6ef6494 SPU: cleanup former OOM handling
Remove cpu_flag::jit_return.
It's obsolete now, and worked only in SPU ASMJIT anyway.
2019-10-26 21:24:12 +03:00
Nekotekina
b329bb604c SPU LLVM: implemented asynchronous compilation
Implemented interpreter-based pre-recompiler.
Interpreter functions are build with SPU LLVM.
2019-10-21 19:29:34 +03:00
Nekotekina
c69fe0f664 SPU Profiler preview
Add option "SPU Profiler" (disabled by default).
Works only with SPU recompilers.
Results are flushed on pausing.
2019-10-15 17:42:57 +03:00
Eladash
c2278fb879 spu: Mask SRR0 at write 2019-10-08 02:52:33 +03:00
Eladash
feabe71183 SPU: Rewrite BGX 2019-09-28 03:42:22 +03:00
Eladash
e315b39822 SPU: Rewrite CGX 2019-09-28 03:42:22 +03:00
Nekotekina
a6edcca6e6 Use g_fxo for spu_cache 2019-09-26 23:26:36 +03:00
Nekotekina
8517ccfdfa Add new typemap for always existing objects
Not to be confused with singletons or global variables.
2019-08-22 02:13:39 +03:00
JohnHolmesII
22917084d9 Explcitly mark overflow in various SIMD functions. Doing so silently
created warnings.
2019-06-28 01:40:52 +03:00
Lassi Hämäläinen
c963c51a60 Remove unnecessary header includes
- Manually removed lot of unneeded #includes to clean code and reduce
  compilation time
- Reordered some of the #includes to be in more logical order
2019-06-25 17:11:10 +03:00
Nekotekina
b9b591bf02 Fix SPU Loop Detection 2019-06-20 14:46:32 +03:00
Nekotekina
5d45a3e47d Implement cpu_thread::suspend_all
Remove Accurate PUTLLC option.
Implement fallback path for SPU transactions.
2019-06-19 20:36:12 +03:00
Nekotekina
9abb303569 vm: expand reservation lock bit area to 7 bit
This is minor change.
2019-05-19 17:46:55 +03:00
Nekotekina
85920253b3 SPU ASMJIT: fix BISLED
Properly prevent losing branch target (addr) vs get_events result (flags).
Move get_events() to the beginning.
Match BISL indirect_branch() args.
2019-05-17 23:44:19 +03:00
Nekotekina
6416fee986 SPU ASMJIT: fix indirect branch target order
Check stack mirror first, as in SPU LLVM.
2019-05-17 23:44:19 +03:00
Nekotekina
a69329fe02 SPU ASMJIT: Fix Giga mode
This is embarassing.
Fixed local instruction table computation (indirect branch).
2019-05-16 04:11:05 +03:00
Nekotekina
91897fa69d SPU LLVM/ASMJIT: fix BRA/BRASL instructions for PIC
Handle absolute branch addressing correctly.
2019-05-16 02:41:31 +03:00
Nekotekina
a921af1e96 SPU LLVM/ASMJIT: remove minor unnecessary code 2019-05-16 00:52:52 +03:00
Nekotekina
43ae4b3f33 SPU LLVM/ASMJIT: add missing PC clamping
Minor fix, since it's mostly impossible to overflow.
2019-05-16 00:51:47 +03:00
Nekotekina
09eb633f69 SPU ASMJIT: increase stack frame size
It seems Windows has minimal stack frame size 0x28.
2019-05-15 02:16:08 +03:00
Nekotekina
3753d27aba SPU: fix Giga mode (kinda)
Don't scan before the entry point.
Disable stack mirror in SPU LLVM.
Improve analyser logic for holes.
2019-05-14 22:15:04 +03:00
Nekotekina
c481472faf SPU ASMJIT: add PIC support (fix)
Also cleanup and adapt for GHC CC.
2019-05-14 22:15:04 +03:00
Nekotekina
1eed421774 SPU LLVM: use branch patchpoints again
Renewed and adapted for PIC and all branch types.
This may address performance degradation after #5923.
2019-05-14 22:15:04 +03:00
Nekotekina
cc8c635855 SPU: PIC support preview
SPU ASMJIT not supported yet.
Giga mode not supported properly.
2019-05-14 22:15:04 +03:00
Nekotekina
15bd3b8724 SPU: fix minor UB in STQD/LQD instructions 2019-05-02 18:00:49 +03:00
Nekotekina
a4c4ee9cb2 SPU: fix excessive cache size regression 2019-05-02 13:39:43 +03:00
Nekotekina
52c589ed3d Revert disabling AVX path in SPU verification.
It was experimental and builds for tests are available in history.
2019-04-16 23:49:18 +03:00
Nekotekina
136fc8cfe3 SPU ASMJIT: avoid AVX in verification (experimental) 2019-04-14 18:03:45 +03:00
Nekotekina
c1edae73c5 SPU ASMJIT: move vzeroupper a bit 2019-04-14 15:10:54 +03:00
Nekotekina
8deb20e928 SPU: write cache before compiling 2019-04-13 22:56:11 +03:00
eladash
969af86eba SPU: Implement BISLED
DFCMGT instruction removed, it was wrong to add to begin with

ASMJIT: Fix compilation of double compare instructions, move exception to runtime instead of compiletime!
Jarves confirmed that he implemented this instruction because of that bug with asmjit only, affected God Of War 3
2019-04-11 17:47:52 +03:00
Nekotekina
4b381fbbb1 Implement spu_runtime::reset
To handle JIT: Out Of Memory error.
2019-03-23 02:43:41 +03:00
Nekotekina
fb64b28886 SPU LLVM: reintroduce branch patchpoints
Previously only used on SPU ASMJIT, may improve perf in some cases.
Now refactored to spu_runtime::make_branch_patchpoint.
2019-03-01 00:08:20 +03:00
Nekotekina
50922faac9 Remove SPUThread::jit_dispatcher
Use global array - save memory
Move the array to JIT memory
2019-01-29 03:32:16 +03:00
Nekotekina
4292997a01 Added jit_runtime class
Is a memory manager for ASMJIT, replaces asmjit::JitRuntime
Unified memory manager for ASMJIT and LLVM
Unified SPU trampoline generation
Remove previous workarounds
2019-01-29 03:32:16 +03:00
Nekotekina
4f152ad126 SPU: multithread compilation
Allow parallel compilation of SPU code, both at startup and runtime
Remove 'SPU Shared Runtime' option (it became obsolete)
Refactor spu_runtime class (now is common for ASMJIT and LLVM)
Implement SPU ubertrampoline generation in raw assembly (LLVM)
Minor improvement of balanced_wait_until<> and balanced_awaken<>
Make JIT MemoryManager2 shared (global)
Fix wrong assertion in cond_variable
2019-01-22 22:02:02 +03:00
elad
fc92ae4085 SPU/PPU atomics performance and LR event fixes (#5435)
* Fix SPU LR event setting in atomic commands according to hw test
* MFC: increment timestamp for PUT cmd in non-tsx path
* MFC: fix reservation lost test on non-tsx path in regard to the lock bit
* Reservation notification moved out of writer_lock scope to reduce its lifetime
* Use passive_lock/unlock in ppu atomic inctrustions to reduce redundancy
* Lock only once for dma transfers (non-TSX)
* Don't use RDTSC in reservation update logic
* Remove MFC cmd args passing to process_mfc_cmd
* Reorder check_state cpu_flag::memory check for faster unlocking
* Specialization for 128-byte data copy in SPU dma transfers
* Implement memory range locks and isolate PPU and SPU passive lock logic
2019-01-15 18:31:21 +03:00
eladash
f19fd23227 spu: Fix support for multiple lists when one is stalled 2019-01-15 02:33:22 +03:00
Nekotekina
488928eca2 Fix SPU STOP instruction
Check thread state after STOP instruction
2018-11-05 14:35:50 +03:00
Nekotekina
1b37e775be Migration to named_thread<>
Add atomic_t<>::try_dec instead of fetch_dec_sat
Add atomic_t<>::try_inc
GDBDebugServer is broken (needs rewrite)
Removed old_thread class (former named_thread)
Removed storing/rethrowing exceptions from thread
Emu.Stop doesn't inject an exception anymore
task_stack helper class removed
thread_base simplified (no shared_from_this)
thread_ctrl::spawn simplified (creates detached thread)
Implemented overrideable thread detaching logic
Disabled cellAdec, cellDmux, cellFsAio
SPUThread renamed to spu_thread
RawSPUThread removed, spu_thread used instead
Disabled deriving from ppu_thread
Partial support for thread renaming
lv2_timer... simplified, screw it
idm/fxm: butchered support for on_stop/on_init
vm: improved allocation structure (added size)
2018-10-19 22:22:35 +03:00
Nekotekina
ed9fb8405b Move rotate/cntlz/cnttz helpers to Utilities/asm.h 2018-09-08 00:32:04 +03:00