Commit graph

148 commits

Author SHA1 Message Date
Nekotekina 471db3219d Finalize constexpr ppu_decoder<> thing
Move SSSE3 checks to runtime in PPUInterpreter.cpp
2020-03-25 11:18:48 +03:00
Eladash e1cb827488 PPU Precise: Fix FMADDS, FMSUBS, FNMSUBS, FNMADDS 2020-03-21 16:32:09 +03:00
Nekotekina Aux1 250736ece5 Fix warnings in emucore 2020-03-04 21:23:34 +03:00
Nekotekina 5e75a0c497 Disable cotire on travis
Make some workarounds for clang because it poorly supports -Wold-style-cast
2020-02-21 17:03:54 +03:00
Nekotekina 92e3eaf3ff Fix signed-unsigned comparisons and mark warning as error (part 2). 2020-02-19 22:54:58 +03:00
Megamouse fe75311be2 move config structs to own files and clean up some headers 2020-02-17 15:08:17 +03:00
Nekotekina c0f80cfe7a Use attributes for LIKELY/UNLIKELY
Remove LIKELY/UNLIKELY macro.
2020-02-05 10:42:34 +03:00
Nekotekina 327bb2d8f0 Modernize PPU logging (ppu_log variable) 2020-02-01 11:52:24 +03:00
Eladash 923cd7ad72 SPU LLVM: rewrite comparison on non-xfloat path of CFLTU, CFLTS
CFLTU on non-xfloat path is accurate as xfloat path now.
* Also optimize FCTIW like FCTIWZ (PPU)
2019-12-30 22:20:34 +03:00
Eladash 6a4ba9d562 Fix warning about truncation 2019-12-07 10:22:11 +01:00
Nekotekina ad9c9f0183 C-style cast cleanup II 2019-11-30 18:17:45 +03:00
Nekotekina 6ea02c23a0 Fix SSSE3 usage in PPUInterpreter.cpp
Fixup
2019-11-09 20:39:56 +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 0c69b7da8f Fix ppu_interpreter::MTFSFI
Out of bounds error.
2019-09-08 14:50:50 +03:00
isJuhn aaae437ca3 PPUInterpreter.cpp: remove SSE4.1 requirement in FCTIWZ, FCTID and FCTIDZ 2019-09-04 14:05:33 +03:00
eladash 0af342a978 PPU Precise: FPCC handling on float ops implemented 2019-08-18 04:01:16 +03:00
Eladash 19825366f5 Fixup for fixup 2019-08-13 17:55:45 +01:00
Eladash 6d0f2ae58a ppu interpreter: Improve SRD/SLD 2019-08-13 04:56:00 +03:00
Eladash a560498cd4 ppu: Improve FCTIW, FCTIWZ, FCTID and FCTIDZ 2019-08-13 04:56:00 +03:00
Eladash 43f919c04b Fixup after #6143 (#6146)
vm::spu max address was overflowing resulting in issues, so cast to u64 where needed. Fixes #6145.
    Use vm::get_addr instead of manually substructing vm::base(0) from pointer in texture cache code.
    Prefer std::atomic_thread_fence over _mm_?fence(), adjust usage to be more correct.
    Used sequantially consistent ordering in semaphore_release for TSX path as well.
    Improved memory ordering for sys_rsx_context_iounmap/map.
    Fixed sync bugs in HLE gcm because of not using atomic instructions.
    Use release memory barrier in lwsync for PPU LLVM, according to this xbox360 programming guide lwsync is a hw release memory barrier.
    Also use release barrier where lwsync was originally used in liblv2 sys_lwmutex and cellSync.
    Use acquire barrier for isync instruction, see https://devblogs.microsoft.com/oldnewthing/20180814-00/?p=99485
2019-06-29 18:48:42 +03:00
Eladash 1ee7b91646 Refactoring (#6143)
Prefer vm::ptr<>::ptr over vm::get_addr.
    Prefer vm::_ptr/base over vm::g_base_addr with offset.
    Added methods atomic_t<>::bts and atomic_t<>::btr .
    Removed obsolute rsx:🧵:Read/WriteIO32 methods.
    Removed wrong check in semaphore_release.
    Added handling for PUTRx commands for RawSPU MFC proxy.
    Prefer overloaded methods of v128 instead of _mm_... in VPKSHUS ppu interpreter precise.
    Fixed more potential overflows that may result in wrong behaviour.
    Added io/size alignment check for sys_rsx_context_iounmap.
    Added rsx::constants::local_mem_base which represents RSX local memory base address.
    Removed obsolute rsx:🧵:main_mem_addr/ioSize/ioAddress members.
2019-06-29 01:27:49 +03:00
JohnHolmesII ebb1ae6408 Properly ignore SIMD macros to avoid warning 2019-06-28 01:40:52 +03:00
Lassi Hämäläinen c963c51a60 Remove unnecessary header includes
- Manually removed lot of unneeded #includes to clean code and reduce
  compilation time
- Reordered some of the #includes to be in more logical order
2019-06-25 17:11:10 +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 dfd50d0185 Implement std::bit_cast<>
Partial implementation of std::bit_cast from C++20.
Also fix most strict-aliasing rule break warnings (gcc).
2019-06-02 23:22:16 +03:00
Nekotekina 5d33d9a3d9 Enable most warnings in GCC 2019-05-11 02:13:19 +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 a9014a8cac ppu Fast/Precise: Fix SIMD instructions VSUM2SWS, VPKSWSS, VPKSHUS, VPKSHSS
Also rewrite VPKSHUS for speed.
2019-04-11 17:47:52 +03:00
eladash e21504d52d ppu interpreter: Improve FPCC field handling 2019-04-11 17:47:52 +03:00
eladash fb8302817f ppu: Set link unconditionally 2018-12-10 01:34:02 +03:00
scribam 8540399ecb ppu-interpreter: improve vminfp instruction 2018-10-12 21:30:14 +03:00
scribam 39272eef45 ppu-interpreter: improve vsl/vsr instructions 2018-10-08 00:15:26 +03:00
scribam cc846eb670 ppu-interpreter: improve fnmadd/fnmadds instructions (#5183)
* ppu-interpreter: improve fnmadd instruction

* ppu-interpreter: improve fnmadds instruction
2018-10-04 00:49:19 +03:00
scribam f294729b28 ppu: improve lvebx/lvehx/lvewx instructions 2018-09-11 21:20:52 +03:00
Nekotekina ed9fb8405b Move rotate/cntlz/cnttz helpers to Utilities/asm.h 2018-09-08 00:32:04 +03:00
scribam c5c0f68b3e ppu-precise: improve vaddsws and vadduws instructions 2018-07-22 19:53:28 +04:00
scribam 2ed6e51d24 ppu: improve vnmsubfp instruction 2018-07-09 03:33:05 +04:00
scribam 733efc6b0d ppu: improve fnmsubs instruction 2018-07-09 03:33:05 +04:00
scribam f1e6532ec0 ppu: improve fnmsub instruction 2018-07-09 03:33:05 +04:00
isJuhn 83f096c435 Add conditional reservation update to STW 2018-06-23 23:13:34 +04:00
scribam 824ad4fea7 cmake: simplify glslang integration (#4652)
* cmake: simplify glslang integration

* Fix warning (ignored attributes), part 2
2018-06-06 15:45:28 +03:00
Nekotekina cce0ad0c35 Clean vm::ps3 namespace use 2018-02-09 17:49:37 +03:00
Nekotekina 83da7f9b63 PPU: remove SSSE3 dependency 2017-12-20 01:21:15 +03:00
Nekotekina 1ae8850b3f PPU: rewrite VMHRADDSHS without SSSE3 2017-12-20 00:04:09 +03:00
Nekotekina 140a581d23 PPU: redesign LVSL, LVSR instructions 2017-12-20 00:04:09 +03:00
Nekotekina df2fc13b7a Add PPU instruction stat dumper
Needs PPU Debug option to activate and PPU Interpreter
Dumps after Resume (after Pause)
Fix utils::memory_decommit, clean vm.cpp
2017-10-11 20:06:33 +03:00
Nekotekina 85f8a42bd2 PPU: MTOCRF optimization 2017-06-29 17:48:55 +03:00
Nekotekina 2629f9be44 PPU: VREFP, VRSQRTEFP changed 2017-06-29 17:48:55 +03:00
Nekotekina fc2a45d6d6 Removed unnecessary code 2017-06-29 17:48:55 +03:00
Nekotekina aea094730b PPU LLVM: paradigm shift
For now, compile only one block at time
Use tail calls to move between blocks
Fully write PPU context (except CIA)

This fixes many compatibility problems
2017-06-23 20:09:33 +03:00
Wilfried Rabouin 7ab210432e PPU interpreter (precise): SAT bit implemented (#2736) 2017-04-30 21:05:50 +03:00
Nekotekina 3bfe17a14f PPU: HACK instruction removed
Breakpoints fixed
2017-03-22 23:23:47 +03:00
Nekotekina c4bdc930ca Fix UB in PPU interpreter 2017-03-17 20:23:03 +03:00
Nekotekina 5e3bacbd9b New reservations
Memory system cleanup
sys_memory_get_page_attribute
2017-03-10 15:51:40 +03:00
Nekotekina 3baf79f929 ror64 added 2017-03-04 17:34:59 +03:00
Wilfried Rabouin 67ac8bf070 PPUInterpreter: Fix undefined behavior of left rotate functions (#2469)
* PPUInterpreter: Fix undefined behavior of rol8 and rol16 with inline assembly

* PPUInterpreter: Fix undefined behavior of rol32 and rol64

* PPUInterpreter: Change left rotate functions to inline functions and move to types.h
2017-03-04 16:41:40 +03:00
Nekotekina f4b95c0226 PPU analyser improved 2017-02-12 21:12:08 +03:00
Nekotekina 47b4c649f1 PPU fixes 2017-02-07 16:37:30 +03:00
Nekotekina 1705638e25 MFVSCR error removed 2017-01-26 20:01:16 +03:00
Nekotekina 84d0d396ed EXPECTS usage removed 2016-08-15 16:29:38 +03:00
Nekotekina 05fb57baff VERIFY macro removed 2016-08-15 03:13:31 +03:00
Nekotekina a7e808b35b EXCEPTION macro removed
fmt::throw_exception<> implemented
::narrow improved
Minor fixes
2016-08-08 19:19:32 +03:00
Nekotekina 5a36c57c57 Formatting system improved
`unveil<>` renamed to `fmt_unveil<>`, now packs args to u64 imitating va_args
`bijective...` removed, `cfg::enum_entry` now uses formatting system
`fmt_class_string<>` added, providing type-specific "%s" handler function
Added `fmt::append`, removed `fmt::narrow` (too obscure)
Utilities/cfmt.h: C-style format template function (WIP)
Minor formatting fixes and cleanup
2016-08-04 21:34:00 +03:00
Nekotekina f8719c1230 PPUThread refactoring
`CallbackManager` removed, added _gcm_intr_thread for cellGcmSys
`PPUThread` renamed to `ppu_thread`, inheritance allowed
Added lightweight command queue for `ppu_thread`
Implemented call stack dump for PPU
`get_current_thread_mutex` removed
`thread_ctrl::spawn`: minor initialization fix
`thread_ctrl::wait_for` added
`named_thread`: some methods added
`cpu_thread::run` added
Some bugs fixes, including SPU channels
2016-07-30 16:35:02 +03:00
Nekotekina eb377f425c PPU LLVM: Analyser fix
ppu_branch_target removed
2016-07-14 16:27:14 +03:00
Nekotekina a8bebcba55 LLVM AOT 2016-06-19 21:29:48 +03:00
Nekotekina e2d82394f6 Cell 2016-05-23 16:22:23 +03:00
John ce3fdeda5e Replace math macros by function calls from cmath. (#1695) 2016-05-19 19:15:56 +03:00
Ivan aafcf44581 Header optimizations (#1684)
Shouldn't break anything. I hope.
2016-04-27 01:27:24 +03:00
Ivan da7472fe81 Optimizations (#1680)
* Optimizations

1) Some headers simplified for better compilation time
2) Some templates simplified for smaller executable size
3) Eliminate std::future to fix compilation for mingw64
4) PKG installation can be cancelled now
5) cellGame fixes
6) XAudio2 fix for mingw64
7) PPUInterpreter bug fixed (Clang)

* any_pod<> implemented

Aliases: any16, any32, any64
rsx::make_command fixed
2016-04-25 13:49:12 +03:00
Nekotekina c4e99dbdb2 Partial commit: Cell 2016-04-15 19:22:34 +03:00
Nekotekina 960668ecf1 For #1355
offsetof() eliminated
OFFSET_32, SIZE_32, ALIGN_32 used
2016-01-14 19:07:27 +03:00
Nekotekina 3ed603074c Changes done by [DH] rewritten
Added rsx_program_decompiler submodule
Added fs::dir iterator
Added fmt::match
2015-12-22 23:11:20 +03:00
Nekotekina 5f6caf33f0 MINGW64: Compilation fix 2015-11-16 19:12:51 +03:00
Nekotekina a974ee009e vm::var improved, cleanup
Mostly vm::var initialization introduced.
Added vm::make_var function.
2015-10-14 18:17:37 +03:00
Nekotekina 59f1077a36 Cleanup, be_t fixed
Some functions renamed:
get_ps3_function_name
execute_syscall_by_index
2015-09-22 13:28:34 +03:00
Nekotekina 6f3c50eba2 u128 renamed to v128
Since it's vector union type
2015-08-24 21:22:23 +03:00
Nekotekina ff1f6d3d4f PPUInterpreter formal fix (affects nothing) 2015-08-01 14:38:53 +03:00
Nekotekina 2f7fe35f5c Minor style change 2015-07-21 23:14:31 +03:00
Nekotekina c0f13f7084 sleep_queue_t rewritten, used in sys_cond/sys_mutex
Some synchronization fixes
2015-07-10 04:31:34 +03:00
Nekotekina 83321c5be7 sys_time_get_current_time fixed, CALL_FUNC draft 2015-07-10 04:31:30 +03:00
Nekotekina 721ad404d2 VM_CAST macro 2015-07-10 04:31:23 +03:00
Nekotekina 6f1e76198a Some fixes 2015-07-10 04:31:18 +03:00
Nekotekina 3aefa2b4e1 ThreadBase rewritten (wip) 2015-07-10 04:31:16 +03:00
Nekotekina ef6f9f6ded be_t constructor implemented, make() eliminated
be_t enums are forbidden, le_t improved, some operators cleaned.
2015-07-10 04:31:07 +03:00
Nekotekina 78fdcf75e7 Attribute macro changed
__forceinline -> force_inline
__noinline -> never_inline
printf_alike(x,y) added
2015-05-28 18:14:22 +03:00
Nekotekina 26b5eebc17 Bugfixes 2015-04-04 19:00:02 +03:00
Nekotekina 1c82e8b1d5 Bugfixes 2015-04-03 19:56:57 +03:00
Nekotekina 59effb3412 PPU: some instructions replaced 2015-04-02 18:22:43 +03:00
Nekotekina 6b9a6c50fe PPU: some instructions replaced 2015-04-01 17:01:04 +03:00
Nekotekina 72fdcf120c PPU: some instructions replaced 2015-03-31 17:54:41 +03:00
Nekotekina 3247152ff7 PPU: some instructions replaced 2015-03-29 14:00:10 +03:00
Nekotekina d640aba903 PPU: some instructions replaced 2015-03-26 21:42:12 +03:00
Nekotekina 75fa95c7ff PPU: some instruction replaced 2015-03-24 22:54:15 +03:00
Nekotekina 620e937473 Basic load 2015-03-17 23:03:24 +03:00
Nekotekina 573f112b37 Small update 2015-03-17 03:44:35 +03:00
Nekotekina 0ca4c189a5 Small update 2015-03-17 02:18:13 +03:00
Nekotekina a71cb5f521 Basic concept 2015-03-17 00:38:21 +03:00