Commit graph

290 commits

Author SHA1 Message Date
Eladash 69a90ef9e7 rsx/cpu_thread: Fix cpu_thread::get_name() for RSX 2024-03-07 14:31:41 +02:00
Elad.Ash 148edc005a Improve cpu_flag::yield handling 2024-02-11 20:09:01 +02:00
Elad Ashkenazi ec59f4d37e PPU/LV2: Implement HW threads switching delay when signaling higher priority threads
In real PS3 (it seems), when a thread with a higher priority than the caller is signaled and that there is available space on the running queue for the other hardware thread to start It prioritizes signaled thread caller's hardware thread switches instantly to the new thread code while signaling to the other hardware thread to execute the caller's code.
Resulting in a delay to the caller after such thread is signaled
2024-02-11 20:09:01 +02:00
Eladash c7c2baae03 Savestates: Implement 'autostart off' mode for debugging 2023-11-27 12:36:17 +02:00
Eladash 5baec6cb58 Add Savestate-Compatible mode 2023-10-01 12:00:41 +03:00
Eladash 099c74481d Savestates: Optimize SPU pausing 2023-10-01 12:00:41 +03:00
Ivan Chikish d34287b2cc Linux: use futex_waitv syscall for atomic waiting
In order to make this possible, some unnecessary features were removed.
2023-08-02 21:46:06 +03:00
Eladash 75ad56338b SPU/Non-TSX: Implement cuncurrent reservations 2023-07-27 02:50:01 +03:00
Eladash 9fc5f6271b Update SPU reservation notifier mask 2023-07-23 17:58:54 +03:00
Eladash c44cddabfa CPUThread.cpp: Fix use of cpu_counter::add
This also fixes a crash when saving savestate because main thread uses cpu_counter::suspend_all which adds cuncurrency.
2023-07-23 17:58:54 +03:00
Eladash c0280b43f2 PPU/Debugger: View the currently used CR field content in register panel 2023-07-12 13:22:06 +03:00
Eladash 16579e0b1f Fix spu_thread::cleanup() 2023-06-06 09:48:27 +02:00
Elad Ashkenazi 23c710cf53 CPUThread.cpp: Fix an emulator crash on game exit 2023-05-22 20:04:49 +03:00
Eladash 0da81d22d3 SPU Profiler: fix CPU usage when emulation is paused
Avoid collecting samples when the thread paused.
2022-10-20 11:22:33 +03:00
Eladash 52b993095d SPU Profiler: nearly always print on Emu.Pause() 2022-10-20 11:22:33 +03:00
Eladash d25d1ecb3a LV2: Avoid using multi-variable atomic waiting on cpu_thread::state wait 2022-10-04 16:28:34 +03:00
Eladash 58dd2bff41 Savestates: Fix unintentional pause when saving with HLE VDEC contexts 2022-10-04 14:14:38 +03:00
Eladash 194f7375da SPU/LV2: Fix tiny race conditions 2022-09-21 20:35:34 +03:00
Nekotekina b49a1f27eb Warning fixes 2022-09-17 16:35:02 +03:00
Eladash 9d9e18f614 CPU preemption control: don't yield if we can't stop 2022-09-16 18:57:55 +03:00
Eladash fc331da883 CPU preemption control: remove yield before thread stop 2022-09-16 18:57:55 +03:00
Eladash b6d3fa8c66 CPU preemption control: avoidance in reservation operations 2022-09-16 18:57:55 +03:00
Eladash cf4da5c4d1 CPU preemption control: bugfixes 2022-09-16 18:57:55 +03:00
Eladash 9d1ec0b319 CPU preemption control: try to minimize sleep time gaps between setups 2022-09-16 18:57:55 +03:00
Eladash ec7b18dab5 Implement independent CPU preemptions 2022-09-13 19:28:20 +03:00
Eladash cfdc852f03 SPU: Power consumption reduction when using SPU inaccurate reservations 2022-09-13 11:21:01 +03:00
Eladash daf43989fc Thread.h: Improve thread abort performance 2022-08-25 23:54:56 +03:00
Eladash 133e9d4705 CPUThread.cpp: Fix cpu_flag::pending reset 2022-08-11 11:42:16 +03:00
Elad Ashkenazi c4cc0154be LV2: Optimizations and fixes
Fix and optimize sys_ppu_thread_yield

Fix LV2 syscalls with timeout bug. (use ppu_thread::cancel_sleep instead)

Move timeout notification out of mutex scope

Allow g_waiting timeouts to be awaked in scope
2022-08-11 11:42:16 +03:00
Eladash 73aaff1b29 LV2: allocation-free synchronization syscalls
* Show waiters' ID in kernel explorer.
* Remove deque dependency from sys_sync.h
2022-08-07 20:23:54 +03:00
Eladash 3e51426379 Savestates/SPU: Kill emulation when its safe to save SPU state 2022-07-15 09:30:53 +03:00
Elad Ashkenazi fcd297ffb2
Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
Eladash 5e01ffdfd8 Debugger: Optimize cpu_thread::dump_regs()
Reuse string buffer. Copies and reallocations are expensive with such large strings.
2022-06-23 22:41:32 +02:00
Nekotekina 653a9e6e7f Debugger: always print cpu_thread::dump_misc()
Was removed for some reason.
2022-06-22 18:53:29 +03:00
Eladash ccb2724fc4 Debugger: Implement SPU breakpoints 2022-06-21 16:59:45 +03:00
Eladash 1cab99b3ca Make CPU Profiler able to print stats which sum up the records of all SPU threads
Hitherto the statistics have been exclusively thread-specific.

Other improvements:
* Fixed container management so a collision of a new element with an older element of the record will become impossible.
* Added thread name to thread-specific information printing.
* Fixed condition to abort SPU block statistics collection, now matches SPU LLVM Profiler's.
* Fix possible division by 0 by checking `samples`.
2022-05-07 12:57:54 +03:00
Nekotekina 6d3052c5dd Optimization: disable atomic_wait_engine notify callback for SPU
Disable placebo callback calls in notify_all.
Don't use callback at all if TSX.
Based on kd-11 findings.
2022-04-24 13:15:54 +03:00
Eladash 6783bcd273 Log a snippet of guest thread code at crash 2022-04-15 22:34:51 +03:00
Nekotekina 580bd2b25e Initial Linux Aarch64 support
* Update asmjit dependency (aarch64 branch)
* Disable USE_DISCORD_RPC by default
* Dump some JIT objects in rpcs3 cache dir
* Add SIGILL handler for all platforms
* Fix resetting zeroing denormals in thread pool
* Refactor most v128:: utils into global gv_** functions
* Refactor PPU interpreter (incomplete), remove "precise"
* - Instruction specializations with multiple accuracy flags
* - Adjust calling convention for speed
* - Removed precise/fast setting, replaced with static
* - Started refactoring interpreters for building at runtime JIT
*   (I got tired of poor compiler optimizations)
* - Expose some accuracy settings (SAT, NJ, VNAN, FPCC)
* - Add exec_bytes PPU thread variable (akin to cycle count)
* PPU LLVM: fix VCTUXS+VCTSXS instruction NaN results
* SPU interpreter: remove "precise" for now (extremely non-portable)
* - As with PPU, settings changed to static/dynamic for interpreters.
* - Precise options will be implemented later
* Fix termination after fatal error dialog
2022-01-15 06:48:04 +03:00
Megamouse c7e5a62909 Add missing cpu_flag formatting 2021-10-05 20:16:11 +02:00
Ani df96be199b config: Remove Lower SPU Priority setting 2021-09-26 00:29:21 +01:00
Eladash ddec5d6908 CPUThread: Prevent recursive check_state calls 2021-09-17 14:02:22 +03:00
Eladash 975aae1d13 SPU MFC: Implement MFC commands execution shuffling 2021-09-17 11:38:10 +03:00
Nekotekina 286e154d05 SPU Profiler: adjust accumulation logic
Don't append trampoline time to verification time.
2021-08-01 09:59:00 +03:00
Nekotekina 2f6db5802f Fix CPU Profiler regression 2021-07-30 09:21:11 +03:00
Eladash 0aed00a758
Improve thread aborting mechanism (#10490)
Call pseudo-virtual operator=(thread_state) of thread context.
2021-06-27 11:43:48 +03:00
Eladash 76bf720adf Improve emulation stopping speed
Split phases of signalling threads and joining them.
2021-06-08 18:26:14 +03:00
Eladash 6ff9aab2ca Fix cpu_thread::check_state() cpu_flag::temp support 2021-05-28 20:25:16 +03:00
Eladash 5f47730fc0 Fix reservations handling in logs
Remove reservation cb.
2021-05-28 20:25:16 +03:00
Nekotekina 2491aad6f2 types.hpp: implement min_v<>, max_v<>, SignedInt, UnsignedInt, FPInt concepts
Restrict smax to only work with signed values for consistency.
Cleanup <climits> includes.
Cleanup <limits> includes.
2021-05-23 19:43:51 +03:00