Commit Graph

11430 Commits

Author SHA1 Message Date
Nekotekina
5f010c2f4c atomic.cpp: optimize "cond" allocation with TLS
Billions of events can reduce to thousands, saving CPU time a few s.
Only 4 slots are available (arbitrarily), and only 1 is usually used.
Other slots are used only for waiting on multiple atomics.
2020-11-20 19:13:22 +03:00
Nekotekina
c0f3d1f06d Basic constexpr support for u128 (MSVC)
Added explicit conversion op to u64.
Added constexpr path for +,-,>>,<< ops.
Make almost all methods constexpr.
Removed a lot of redundancy.
2020-11-20 15:04:17 +03:00
Nekotekina
6c18e00977 atomic.cpp: use deterministic "cond" allocation
Takes ~80 ns instead of ~40 ns, same about deallocation.
Loops don't exist here, only 4-level semaphore tree.
Worst case only happens with concurrence, not from looping.
This optimization is not really necessary at current state of RPCS3.
This is more like to test C++ compilers and MSVC u128 implementation.
2020-11-20 15:04:17 +03:00
Nekotekina
72ac1aa537 atomic.cpp: use some actual hash for hashtable (std::minstd_rand)
Should only take about 5ns for initialization.
Should also make collisions almost impossible.

I also suspect I fixed some bad bug in process...
2020-11-20 15:04:17 +03:00
Nekotekina
5bcaa25c02 CPU: remove descheduled threads from suspend_all list 2020-11-20 13:53:34 +03:00
Eladash
85880ffded
SPU: Log STOP full opcode (#9292)
Co-authored-by: Ani <ani-leo@outlook.com>
2020-11-20 13:53:16 +03:00
Megamouse
5b207c3b95 hotfix for infinite loop when booting game data 2020-11-19 23:53:10 +01:00
Megamouse
3087f15dd8
Update disc boot detection and hope it works 2020-11-19 21:55:06 +01:00
Nekotekina
36f1193497 Fix u128 type on MSVC (subtraction, minus)
All subtraction operations were broken.
2020-11-19 16:38:06 +03:00
Nekotekina
292af1e4cd CPU: use u128 in bit counter
Apparently, u64 was not enough.
2020-11-19 16:05:08 +03:00
Nekotekina
d4d5dc99f3 Fix perf_meter<> after adding thread pool.
Print and reset sorted information after emulation stop/pause.
Print useless average value.
2020-11-19 14:44:58 +03:00
Nekotekina
3e1344e4e4 vm.cpp: minor optimization for filling stack guards
Use REP STOSQ on all compilers.
2020-11-19 14:44:58 +03:00
Nekotekina
6d37bc62a5 CPU: remove cpu_counter from g_fxo
Convert it to a namespace, simplify add/remove functions.
Don't add() threads just creates, they are trapped in check_state() anyway.
Don't add() threads which are leaving check_state() because stopped.
2020-11-19 09:46:22 +03:00
Nekotekina
e9f7c100a0 CPU: update suspend interface (dummy) 2020-11-18 19:15:56 +03:00
Nekotekina
190676c982 CPU: Fix g_suspend_counter waiting logic 2020-11-18 14:38:01 +03:00
Eladash
28cbba5a7d
SPU LLVM: fix AND instruction family (#9290)
Incorrect immediate test (looks like copypasta)
2020-11-18 14:36:26 +03:00
kd-11
0e7a705254 rsx: Resolution scaling overhaul
- Enforce square pixels instead of per-axis scaling
2020-11-18 09:29:34 +03:00
Nekotekina
68931b4c43 Debugger: fill stack guard with STACKGRD 2020-11-17 16:32:59 +03:00
Nekotekina
a4e28df9cf Update hidapi 2020-11-17 15:40:09 +03:00
Nekotekina
65c81c5e83 Fix memory viewer for SPU LS 2020-11-17 15:22:04 +03:00
Nekotekina
ccd0d2046d SPU: increase max SPU count
According to max SPU TG count.
2020-11-17 15:22:04 +03:00
Nekotekina
0fec99e75b SPU: absolutely unacceptable hack for SPU LS
Make normal threads inaccessible in PS3 memory.
2020-11-17 15:22:04 +03:00
Nekotekina
f8d1f070f5 sys_memory: HORRIBLE HACK for sys_memory_get_page_attributes 2020-11-17 15:22:04 +03:00
Nekotekina
3dd48a24ce atomic.cpp: remove tiny redundancy 2020-11-17 15:22:04 +03:00
Nekotekina
984e97cbdc Potential fix for Linux compilation 2020-11-17 15:22:04 +03:00
Eladash
50ea1a12c9 Debugger: Fix scrolling in first registers panel 2020-11-17 09:39:39 +01:00
Eladash
992a372fc7 cellGame fixes 2020-11-17 09:04:35 +01:00
Nekotekina
d789250976 Add thread_ctrl::get_thread_stack
Returns addr and size of current thread's stack.
2020-11-17 05:33:46 +03:00
Nekotekina
d7e1cf7dd2 vm: respect initial protection for allocation mapping
Unused yet.
2020-11-17 05:33:46 +03:00
Nekotekina
ea5f5aea5f vm: memory locking rewritten
Added vm::lock_sudo method (wrapper for utils::memory_lock).
Put locking outside of vm::g_mutex scope.
Prelock sudo memory for RSX, vm::stack, vm::main.
Prelock sudo memory for shared memory objects.
Don't check for TSX path.
2020-11-16 12:46:15 +03:00
Nekotekina
eaf0bbc108 SPU: don't allocate SPU LS in vm::main
Create its own shared memory object.
Use vm::spu to allocate all SPU types.
Use vm::writer_lock for shm::map_critical.
2020-11-16 12:46:15 +03:00
Eladash
b1710bb712
SPU Debugger: Implement float registers view + General debugger fixes (#9265)
* SPU Debugger: Fix try_get_insert_mask_info
* Debugger: Always update thread state on context's data change
No longer needing to press on thread's instructions for actions to work!
2020-11-15 08:45:28 +03:00
Nekotekina
dfae7bd073 SPU: Fix some stat printing 2020-11-15 04:41:16 +03:00
Nekotekina
333fe9a561 atomic.cpp: fix notification on windows 2020-11-15 04:40:44 +03:00
Nekotekina
badb3dc2dd atomic.cpp/threads: remove old wait callback
Add new wait callback which simply collects statistics.
Shift workarounds towards actual problem detection.
2020-11-14 18:16:27 +03:00
Nekotekina
3ac819ee70 atomic.cpp: fix waiting on multiple variables
Silly bugs are so silly...
2020-11-14 17:25:02 +03:00
Nekotekina
00f877e812 atomic.cpp: fix rare overload scenario
If slot allocation fails, increase reference counter in every slot.
This prevents search routine from "losing" some slots.
2020-11-14 13:56:23 +03:00
Nekotekina
1e269751bf Temporarily disable memory locking if TSX is not used
It's a very heavy operation that could cause some problem under mutex lock.
2020-11-14 11:12:58 +03:00
Nekotekina
5b69eda39a Fix suspend_all bug (TSX, TSX-FA)
Could cause freezes.
2020-11-14 10:56:05 +03:00
Nekotekina
71ca413067 Don't add lonely cpu_flag::memory on TSX path (bug) 2020-11-14 09:03:33 +03:00
Nekotekina
0c7f9458c0 Fix thread pool resource management.
Make sure no tail call happens (change ret address to a trampoline).
Make sure thread handles don't leak if the pool is full.
2020-11-13 17:17:45 +03:00
Nekotekina
ab365fe494 Fixed thread pool a bit
Use 128-bit allocator instead of queue.
When pool is full (128), threads just terminate as before.
2020-11-13 13:32:44 +03:00
Nekotekina
e48f160a29 atomic.cpp: continuation of fixing all-ones masks
Also added missing const noexcept.
2020-11-13 12:40:02 +03:00
Nekotekina
cfda4d0ade atomic.cpp: optimize raw_notify() for unspecified pointer mode
Remove unnecessary optimization from cond_alloc().
Optimistic case was absolutely dominating anyway.
Although the whole function is a dirty hack.
Now scanning through all threads is faster.
2020-11-13 07:05:33 +03:00
RipleyTom
debfae06a8 Improve disconnected state handling of dns queries 2020-11-13 07:05:06 +03:00
RipleyTom
e6f2f8ad0d Add some error checking in sceNp2.cpp 2020-11-13 05:28:00 +03:00
Nekotekina
67785a918c Implement simple thread pool 2020-11-13 03:32:24 +03:00
Nekotekina
50d80c64fa Add .gdbinit config file
Set to ignore SIGSEGV and SIGPIPE signals.
2020-11-12 23:43:38 +03:00
RipleyTom
1378645413 Adds SIGPIPE to ignored exceptions(unix) 2020-11-12 07:08:59 +03:00
Nekotekina
3888b0429c atomic.cpp: print some stats on stop 2020-11-12 05:52:22 +03:00