Commit Graph

79 Commits

Author SHA1 Message Date
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
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
Nekotekina
37577714fa SPU LLVM: emulate PSHUFB
For targets without SSSE3 support
2018-05-30 20:35:35 +03:00
Nekotekina
33a1c743a4 Transactions: move loops inside
Rewrite loops in assembler (minor optimization)
2018-05-21 00:18:37 +03:00
Nekotekina
367f039523 Build transactions at runtime
Drop _xbegin family intrinsics due to bad codegen
Implemented `notifier` class, replacing vm::notify
Minor optimization: detach transactions from global mutex on TSX path
Minor optimization: don't acquire vm::passive_lock on PPU on TSX path
2018-05-16 17:31:58 +03:00
Nekotekina
fd525ae1cf Implement build_function_asm
Uses ASMJIT to build function at startup
2018-05-16 15:48:35 +03:00
Nekotekina
a77896c1b6 Update LLVM commit, use small code model 2018-05-13 00:03:08 +03:00