Commit graph

492 commits

Author SHA1 Message Date
Eladash
ec9622b513 Fix ppu_patch invalid address check 2019-12-31 18:57:14 +03:00
Eladash
8427af8886 Implement runtime PPU executable code modification via Cheat Manager 2019-12-31 18:57:14 +03:00
Nekotekina
70e26eeb45 LLVM: compress PPU cache
Compress PPU modules to .gz (backward compatible with uncompressed cache)
2019-12-27 23:12:16 +03:00
Nekotekina
185c067d5b C-style cast cleanup V 2019-12-03 17:23:00 +03:00
Nekotekina
28eacc616a C-style cast cleanup III 2019-12-01 00:32:44 +03:00
Nekotekina
a83cbf63c6 Remove gsl::finally only use 2019-11-09 19:30:06 +01:00
Nekotekina
1cca00ec3a Fix SSSE3 usage in PPUThread.cpp
Remove legacy ifdefs, allow SSSE3 usage in AppImages.
2019-11-09 20:10:59 +03:00
Nekotekina
191675bf31 Remove gsl::finally only use 2019-11-09 19:11:01 +03:00
Nekotekina
ccac9d4777 Remove throwing and catching cpu_flag::stop
Since there is spu_runtime::g_escape function now.
2019-11-08 19:27:11 +03:00
Nekotekina
587ae17aa2 Simplify fmt::throw_exception
Gradual exception deprecation: disallow choosing exception type.
However, the function itself can remain here forever.
2019-11-08 19:27:11 +03:00
MSuih
f3ed26e9db Small warnings cleanup (#6671)
* Ignore more warnings

These are intentional

* Signed/unsigned mismatch when comparing

* Explictly cast values

* Intentionally discard a nodiscard value

* Change ppu_tid to u32

* Do not use POSIX function name on Windows

* Qt: Use horizontalAdvance instead of width

* Change progress variables to u32
2019-10-25 13:32:21 +03:00
Eladash
c16319f959 PPU Precise: Fix fused float ops misaccuracy by using fma
Also cleanup add64_flags, remove redundent copy of s_ppu_itype.
2019-10-20 20:58:31 +03:00
Nekotekina
49e96b39dd [SPU, TSX] Fix reservation corruption in PUTLLC
Change reservation locking logic.
2019-10-12 15:41:24 +03:00
Nekotekina
a29d4150df GDB Server: fix and cleanup
Move source files to Emu/GDB.cpp, GDB.h
Remove "WITH_GDB" option, enable GDB Server by default.
Change class name to gdb_thread.
Alias for external access gdb_server.
Change config option name to "GDB Server"
Bind on 127.0.0.1 by default.
2019-10-09 00:11:44 +03:00
Nekotekina
b48cdc2260 Use g_fxo for global ppu_module instance
Also fix autonomous PRX/SPU loading sequence.
2019-09-26 23:26:36 +03:00
Nekotekina
4ec3e968ff Use g_fxo for jit_core_allocator 2019-08-27 03:50:15 +03:00
Nekotekina
3dd6961ee5 Use g_fxo in PPUThread.cpp misc
Replace fxm::get_always
2019-08-27 03:50:15 +03:00
eladash
050339bb3e PPU/LV2: Make thread-lists scheduling atomic 2019-08-17 22:46:36 +03:00
Nekotekina
f8f3067deb Always check page_allocated in vm::check_addr 2019-08-14 20:28:34 +03:00
eladash
4f00af6000 ppu interpreter: Allow non-ssse3 to use fast path
byte shuffle is now removed which was the barrier for ssse3 check.
2019-08-13 04:56:00 +03:00
Eladash
3ce18fd960 Implement vm::page_executable (#6330)
Fixes segfaults when attenpting to set segfaults on non-executable memory.
2019-08-11 21:04:17 +03:00
Nekotekina
949f33c8a4 Fix sys_config_get_io_event syscall name 2019-07-29 21:55:59 +03:00
Eladash
85b1152e29 Timers scaling and fixes 2019-07-23 00:09:01 +01:00
Eladash
537d3f2548 Log last function on debug pause or exception, dump cpu_thread state on access violation 2019-07-10 17:35:39 +03:00
Lassi Hämäläinen
499035512b Split Emu/Memory into more logical headers
- Add vm_locking.h and vm_reservation.h and move relevant functions
  and types to these headers.
- Change include order and make vm_ptr.h, vm_var.h and vm_ref.h headers
  usable invidually and them including vm.h instead of other way around
- Because usage of vm::ptr now requires including vm_ptr.h instead of
  vm.h updated multiple #includes
- Added additional #includes to vm_reservation.h and vm_locking to
  where vm::reservation_* and locking related functions are used
2019-06-25 17:11:10 +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
Eladash
d52953fca6 minor UB fix 2019-06-17 02:52:43 +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
7492f335e9 SPU analyser: basic function detection in Giga mode
Misc: fix EH frame registration (LLVM, non-Windows).
Misc: constant-folding bitcast (cpu_translator).
Misc: add syntax for LLVM arrays (cpu_translator).
Misc: use function names for proper linkage (SPU LLVM).

Changed function search and verification in Giga mode.
Basic stack frame layout analysis.
Function detection in Giga mode.
Basic use of new information in SPU LLVM.
Fixed jump table compilation in SPU LLVM.
Disable broken optimization in Accurate xfloat mode.
Make compiled SPU modules position-independent in SPU LLVM.

Optimizations include but not limited to:
 * Compiling SPU functions as native functions when eligible
 * Avoiding register context write-out
 * Aligned stack assumption (CWD alike instruction)
2019-05-11 02:13:19 +03:00
eladash
ea1c9a2e17 Fix PPU Breakpoints and ppu_check_toc 2019-04-29 23:04:16 +03:00
Nekotekina
524aac75ed LLVM DSL: rewrite bitcast, zext, sext, trunc, select, min, max ops
Are made composable in expressions similar to arithmetic ops.
Implement noncast in addition to bitcast (no-op case).
Implement bitcast constant folding.
Fixed some misuse of sext<>.
2019-04-24 23:55:41 +03:00
eladash
b307aff9eb Prefetch byteswapped opcodes in ppu interpreter 2019-04-11 17:47:52 +03:00
eladash
f028737db8 Implement fallback for PPU LLVM
This matches with interpreter implementation, fixing unregistered functions in lost cases
2019-04-11 17:47:52 +03:00
eladash
e21504d52d ppu interpreter: Improve FPCC field handling 2019-04-11 17:47:52 +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
d873802b9c Use LLVM 9
Use new add/sub with saturation intrinsics
2019-03-30 01:36:48 +03:00
Nekotekina
849411693a PPU LLVM: add MemoryManager3
For temporary allocations.
Add flags in jit_compiler constructor.
2019-03-23 02:43:41 +03:00
Nekotekina
7f6a410770 Add dummy __has_builtin macro, use rotate builtins if possible 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
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
Nekotekina
a419e98acb Move PPU and shader cache
New hash-based location (already used for SPU)
Bump PPU cache version, improve naming and decrease size

Remove fs::get_data_dir
Disable boot.elf cache
2019-01-14 01:24:05 +03:00
Nekotekina
bd9131ae1c Implement fs::get_cache_dir
Win32: equal to config dir for now
Linux: respect XDG_CACHE_HOME if specified
OSX: possibly incomplete
2019-01-13 14:45:36 +03:00
Megamouse
a4f67ccb87 Add log messages for PPU compilation 2018-12-31 23:03:03 +03:00
Nekotekina
96cabeadff Rewrite condition variables
Implement helper functions balanced_wait_until and balanced_awaken
They include new path for Windows 8.1+ (WaitOnAddress)

shared_mutex, cond_variable, cond_one, cond_x16 modified to use it
Added helper function utils::popcnt16
Replace most semaphore<> with shared_mutex
2018-11-29 01:30:05 +03:00
eladash
3a7f5b970f ppu: Fix stack base 2018-11-02 02:16:29 +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
f2229a5f53 PPU reservations: ensure aligned atomic ops
Store aligned 64 bits to ppu.rdata
Don't save reservation size
2018-09-15 17:09:56 +03:00
eladash
cd11ae5d8b ppu: Fix extreme reservation corner case 2018-09-12 23:17:53 +03:00
Nekotekina
d750e955c3 Use std::uncaught_exceptions()
Also remove wrong attributes
2018-09-08 00:32:04 +03:00