Commit graph

640 commits

Author SHA1 Message Date
Nekotekina
b839cc9d5b SPU TSX: restore busy_wait in GETLLAR 2019-05-25 21:41:11 +03:00
Nekotekina
7de3c410cf SPU/PPU: update reservation logic on TSX path transactions
Make use of lock bits in reservation counters.
On PPU, fallback to compare_and_swap instead of desperate retry.
On SPU, lighten write set on retry by 'locking' outside of the transaction.
2019-05-20 14:32:50 +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
f33b81545e SPU: implement recompiler gateway function in assembly
Use GHC calling convention directly for SPU object entry points.
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
eladash
3a5f4ed757 Print SPU Group ID on the debugger 2019-04-20 20:43:58 +01:00
Nekotekina
9060177dbd SPU transactions: add SSE path if AVX is not available
This handles hypothetical situation when AVX is disabled system-wise.
Also refactored register use, to match Windows path with Linux path.
This reduces read set a little at the cost of stack use.
2019-04-16 23:49:18 +03:00
Nekotekina
3354f068fc PPU/SPU transactions: ease cache line interference (TSX path)
Touch memory on the same memory page, but different cache lines.
2019-04-10 13:58:12 +03:00
Nekotekina
71b88cdc82 New SPU interpreter (SPU fast)
Use LLVM to build SPU interpreter.
Simplify interpreter loop.
2019-03-27 20:33:44 +03:00
Nekotekina
4b381fbbb1 Implement spu_runtime::reset
To handle JIT: Out Of Memory error.
2019-03-23 02:43:41 +03:00
Nekotekina
f143035af1 Fix sys_spu_thread_group_join wait condition
After waiting, thread group cannot be safely accessed
Following #5643
2019-03-01 00:08:19 +03:00
eladash
0861226271 Make more use of the new atomic_t<>::release 2019-02-10 00:16:57 +03:00
eladash
e3ee481f01 Make sys_spu_thread_group_join return once per termination 2019-02-10 00:16:57 +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
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
cfdf50dcff SPU: ensure sys_spu_thread_group_join receives correct exit status
Following #5334
2019-01-13 14:45:36 +03:00
eladash
653a4ef0df Set group status INIT on last thread stopped
this fixes the group status after sys_spu_thread_exit when not joining the spu group
2018-12-25 19:59:41 +03:00
elad
90265edfcd SPU MFC: avoid copying of the lockline onto the stack in putllc/putlluc (#5392) 2018-12-04 21:09:55 +03:00
Nekotekina
f442a8a84c SPU TG: add thread group stop counter
Fix possible race condition introduced by waiting on `running` value
2018-11-27 23:37:26 +03:00
Nekotekina
febe4d4a10 Implement class cond_x16
Use as reservation notifier
Limited to 16 threads but allows more precise control of contention
2018-11-26 00:23:29 +03:00
Nekotekina
0044eb44e2 Cleanup after #5310 (SPU thread groups)
Move lambda into a cpu_stop()
Use running thread counter to synchronize with sys_spu_thread_group_join()
Use SPU_STATUS_STOPPED_BY_STOP exclusively for sys_spu_thread_exit() as before
Remove unnecessary waiting in sys_spu_thread_group_exit()
Rollback some minor unnecessary changes
Use shared_mutex in SPU TG
2018-11-14 12:50:24 +03:00
RipleyTom
0e0a82e536 Ensures threads are stopped in join 2018-11-13 10:19:28 +03:00
eladash
2e1aec4de8 Implement sys_spu_thread_tryreceive_event 2018-11-12 21:12:33 +03:00
Nekotekina
488928eca2 Fix SPU STOP instruction
Check thread state after STOP instruction
2018-11-05 14:35:50 +03:00
Nekotekina
f06e6be2c1 Disable npc update for SPU thread groups 2018-11-05 13:14:11 +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
a8a8cd88a0 Implement lf_queue<>, lf_value<>
lf_queue<>: unbound FIFO queue with dynamic linked-list
lf_value<>: concurrently-assignable value readable without locking at the cost of memory (using dynamic linked list)

Add atomic_t<>::compare_exchange
2018-09-27 12:16:43 +03:00
eladash
05cd3712a3 spu: Fix MMIO index checking 2018-09-17 17:24:54 +03:00
scribam
d7bb59cd99 c++17: use std::size 2018-09-06 13:15:59 +03:00
Nekotekina
ca5158a03e Cleanup semaphore<> (sema.h) and mutex.h (shared_mutex)
Remove semaphore_lock and writer_lock classes, replace with std::lock_guard
Change semaphore<> interface to Lockable (+ exotic try_unlock method)
2018-09-03 23:00:36 +03:00
Nekotekina
8abe6489ed Mega-cleanup for atomic_t<> and named bit-sets bs_t<>
Remove "atomic operator" classes
Remove test, test_and_set, test_and_reset, test_and_complement global functions
Simplify atomic_t<> with constexpr if, remove some garbage
Redesign bs_t<> to use class, mark its methods constexpr
Implement atomic_bs_t<> for optimizations
Remove unused __bitwise_ops concept (should be in other header anyway)
Bitsets can now be tested via safe bool conversion
2018-09-03 21:40:36 +03:00
eladash
f349695a75 Rsx: rewrite address translation 2018-08-13 16:16:34 +03:00
eladash
ac99fd764d mfc: clamp atomic cmd's addr 2018-07-14 01:40:40 +04:00
eladash
a5d4e58ddd fix barrier type mfc transfers 2018-07-10 14:54:51 +04:00
Nekotekina
20900ebea2 SPU: rename block stats
Use Block Weight and Retreats
2018-07-06 00:33:52 +03:00
Nekotekina
a0c0d8b993 SPU: simplify unimplemented event check
Move checks closer to the actual use
2018-07-06 00:33:52 +03:00
Nekotekina
e4da284176 SPU: analyser v4 and fixes
Build SPU cache after PPU, fix mixing progress
SPU ASMJIT: add support for Giga mode
SPU ASMJIT: use the same spu.log location as SPU LLVM
SPU: improve spu.log disasm
SPU: improve trampolines, unify with SPU ASMJIT
SPU: decode interrupt handler address from BR/BRA at 0x0
SPU LLVM: support Mega/Giga modes
SPU LLVM: implement function chunks
SPU LLVM: use PHI nodes, value visibility across basic blocks
SPU LLVM: implement function chunk table
New simple memory manager for LLVM (bugfix)
2018-06-21 22:29:34 +03:00
eladash
af62c92b7f mfc: clamp list transfer size 2018-06-17 23:20:00 +04:00
Nekotekina
eb081bbcfa SPU: add 'Accurate PUTLLUC' option
Effectively rollback previous PUTLLUC accuracy commit by default
Minor changes in GETLLAR/PUTLLUC transactions
2018-06-12 02:09:22 +03:00
Nekotekina
12eee6a19e SPU ASMJIT: Implement Mega block mode (experimental)
Disable extra modes for SPU LLVM for now.
In Mega mode, SPU Analyser tries to determine complete functions.
Recompiler tries to speed up returns via 'stack mirror'.
2018-06-05 12:35:26 +03:00
Nekotekina
ec6d1fb1ba SPU: optimize GETLLAR (TSX)
Add an option "Accurate GETLLAR"
2018-06-05 12:35:26 +03:00
Nekotekina
a5f4e6ecef SPU: fix PUTLLUC accuracy 2018-06-04 16:01:17 +03:00
Nekotekina
759370ea1b SPU: rewrite FSM/FSMH/FSMB instructions
Remove lookup tables
2018-05-30 20:35:35 +03:00
Nekotekina
55e9d437a9 Fix warning (ignored attributes) 2018-05-30 20:35:35 +03:00
Nekotekina
bdf6545571 SPU: rewrite spu_interpreter::SHUFB
Use ASMJIT to generate SSSE3+ code at runtime
Remove static SSSE3 code from spu_interpreter
2018-05-30 20:35:35 +03:00
kd-11
d48f391b41 lv2: Ease the pain of lower end CPUs
- Avoid busy waiting in usleep code as much as possible, instead yield
- Also avoid busy_wait for SPU concurrency choker
2018-05-29 13:54:30 +03:00
Nekotekina
3e580afe21 SPU: remove passive lock (fixup) 2018-05-23 15:36:29 +03:00
Nekotekina
72574b11ff SPU: use reservation spinlocks on writes (non-TSX)
This should decrease contention by avoiding global lock
2018-05-21 21:56:14 +03:00
Nekotekina
6fd402bcf8 Transactions: drop RDTSC usage
Use simple increment (minor optimization)
2018-05-21 00:18:37 +03:00