Commit graph

94 commits

Author SHA1 Message Date
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