Commit Graph

85 Commits

Author SHA1 Message Date
Nekotekina 8ce0819b42 SPU: add stx/ftx counters
Just count pure transaction successes and failures.
2020-10-29 18:57:57 +03:00
Nekotekina dc8252bb9f Remove XABORT in PPU/SPU transactions.
It's expensive for unknown reason. Simply XEND is usually much cheaper.
Add some minor improvements. Use g_sudo_addr.
2020-10-20 09:10:21 +03:00
Nekotekina 44c90c060a TSX: improve transaction repeat handling
Handle status 0 as fatal.
2020-10-19 19:41:28 +03:00
Nekotekina 3d980a9f66 Reimplement ASMJIT runtime
Try to emplace generated code in lower address area.
Protect generated code from writing.
2020-10-17 21:25:43 +03:00
Nekotekina f2d2a6b605 JIT cleanup for PPU LLVM
Remove MemoryManager3 as unnecessary.
Rewrite MemoryManager1 to use its own 512M reservations.
Disabled unwind info registration on all platforms.
Use 64-bit executable pointers under vm::g_exec_addr area.
Stop relying on deploying PPU LLVM objects in first 2G of address space.
Implement jit_module_manager, protect its data with mutex.
2020-10-11 17:22:28 +03:00
Nekotekina 050c3e1d6b Rewrite cpu_thread::suspend_all
Now it's a function of higher order.
Make only one thread do the hard work of thread pausing.
2020-10-10 13:58:48 +03:00
Nekotekina e1042bc631 Get rid of "module" keyword
Workaround some intellisense problems.
2020-05-06 18:20:11 +03:00
Nekotekina 6c8d844ec5 PPU LLVM: fix crash on damaged cache files 2020-04-07 16:51:35 +03:00
Nekotekina 91d80aa7b9 Implement jit_compiler::check
Instead of checking file existence (because file may be damaged).
2020-04-07 16:09:47 +03:00
Bird Egop 4e25daffa6
Explicitly rename has_512 into has_avx512 (#7751) 2020-03-10 19:21:00 +03:00
Nekotekina e4a81b1d13 Move Log.h to util/logs.hpp 2020-03-07 12:29:23 +03:00
Nekotekina Aux1 250736ece5 Fix warnings in emucore 2020-03-04 21:23:34 +03:00
Nekotekina 5b0476e772 Update LLVM to new llvm-mirror (LLVM 11)
Use clang-cl to build LLVM on Windows.
2020-03-03 18:33:02 +03:00
gamerforEA 93552a5958 Apply some Clang-Tidy fixes 2020-02-27 00:38:55 +03:00
Nekotekina fa0bf6a92c Fix "unknown pragma" on zlib clang workarounds 2020-02-23 10:42:35 +03:00
Nekotekina 92e3eaf3ff Fix signed-unsigned comparisons and mark warning as error (part 2). 2020-02-19 22:54:58 +03:00
Nekotekina c0f80cfe7a Use attributes for LIKELY/UNLIKELY
Remove LIKELY/UNLIKELY macro.
2020-02-05 10:42:34 +03:00
Nekotekina 3c0bd821c8 Give log channels fancier names
Improve LOG_CHANNEL macro to accept custom name.
2020-02-01 10:43:43 +03:00
Nekotekina d9a0619ddd Remove legacy GENERAL log channel
Add some more log channels instead.
2020-02-01 07:49:38 +03:00
RipleyTom 795bc5d52b Add mutex guard for s_unfire 2020-01-28 19:16:16 +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 068450d4fe CPUTranslator: detect FMA feature 2019-12-20 21:11:07 +03:00
Nekotekina e3e97da7bb LLVM: remove cascadelake workaround and update LLVM fork
VPTERNLOG fix may be necessary.
2019-12-13 16:19:08 +03:00
Nekotekina dbece4d00f LLVM: add workaround for cascadelake CPU
Need to investigate it later.
2019-12-13 02:11:21 +03:00
Nekotekina 835892aa51 C-style cast cleanup VII 2019-12-05 02:10:15 +03:00
Nekotekina bf11a28fb5 C-style cast cleanup IV 2019-12-01 22:12:33 +03:00
Nekotekina 28eacc616a C-style cast cleanup III 2019-12-01 00:32:44 +03:00
Nekotekina fcc841eaa1 LLVM: Add workaround for znver2 2019-11-14 19:09:34 +03:00
Rajko Stojadinovic b49b4c8096 Rewrite the way LLVM JIT does memory allocation to allow use of more than one contiguous segment (#6771) 2019-10-29 01:01:07 +03:00
Nekotekina 2e85b5ebaa SPU: Make JIT allocator lock-free on all platforms 2019-10-26 21:24:12 +03:00
Nekotekina 6e19881b82 Update LLVM (10) 2019-10-23 16:01:14 +03:00
Marin Baron 90aaaceba0 Debug build : Check ObjectFile before reading.
Check LLVM ObjectFile state before access to avoid llvm assertion failure.

Expected<T> must be checked before access or destruction.
Expected<T> value was in success state. (Note: Expected<T> values in success mode must still be checked prior to being destroyed).
2019-10-21 00:40:12 +03:00
Nekotekina eafbc77c0d SPU LLVM: Always use linux-gnu target triple (affects Windows)
Unify internal code generation to make better use of GHC calling convention.
Ideally, it would just work on Windows as well, but some random bug appeared.
This bug was causing freezes on SPU LLVM compilation.
This commit desperately attempts to workaround it.
2019-10-15 18:04:50 +03:00
Nekotekina c4ccac9a9c [TSX] Fix XABORT handling
Break repeat loop after explicit transaction abort.
May have performance consequences.
2019-10-13 19:35:12 +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 a6cde36dc4 Link LLVMAsmParser library 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
Nekotekina d873802b9c Use LLVM 9
Use new add/sub with saturation intrinsics
2019-03-30 01:36:48 +03:00
Nekotekina 4b381fbbb1 Implement spu_runtime::reset
To handle JIT: Out Of Memory error.
2019-03-23 02:43:41 +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 efe067bfa0 LLVM: handle cascadelake CPU name 2019-03-05 21:47:34 +03:00
Nekotekina ebb24375d1 LLVM: handle icelake-client and icelake-server CPU names
Correct AVX / AVX-512 disabling logic
2019-03-01 00:20:04 +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
Nekotekina b2f29cd4d4 LLVM: remove false alarm errors
Writable sections ARE supported
2018-09-27 12:16:43 +03:00
Lassi Hämäläinen 972de4c730 CMake: Fix Linux WITHOUT_LLVM build
- _XABORT_RETRY is defined in immintrin.h which wasn't included
2018-09-19 21:17:01 +03:00
scribam a745f02a07 cleanup: remove compatibility code for old versions of clang 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
scribam b09321354a clang: fix compilation on 3.7 2018-07-15 12:51:09 +04:00
scribam 4babe9076b clang: fix compilation on 3.8 2018-07-15 12:51:09 +04:00