Commit graph

56 commits

Author SHA1 Message Date
Nekotekina 41ee792f95 MSVC: remove MemLeak build support
There are better memleak detection tools.
1) Requires to guard placement new and external libs
2) Doesn't work thoroughly
2020-12-22 14:32:30 +03:00
Nekotekina fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +03:00
Nekotekina e321765c54 Split BEType.h to util/v128.hpp and util/to_endian.hpp 2020-12-13 16:34:45 +03:00
Nekotekina a6a5292cd7 Use uptr (std::uintptr_t alias) 2020-12-12 16:29:55 +03:00
Nekotekina b59f142d4e Move types.h to util/types.hpp 2020-12-12 15:12:01 +03:00
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
Nekotekina 1b8bf081b5 Upgrade to LLVM 11 Stable 2020-11-02 21:23:25 +03:00
Whatcookie 9e4f43f4d1
SPU LLVM: Add icelake optimized paths for SHUFB (#8712) 2020-08-13 15:00:56 +01:00
Whatcookie 4ce2ad54a8
PPU LLVM: Use VPERM2B to emulate VPERM (#8704)
- The VPERM2B instructions are a match of VPERM's behavior, besides operating in reverse byte order
2020-08-09 01:50:26 +01:00
Eladash 6a51c27fde PPU LLVM: Fix VMAXFP, VMINFP NaN handling 2020-08-03 15:43:00 +01:00
Eladash f6764767f6 SPU/PPU LLVM: Fix cpu_translator::get_const_vector<v128>() 2020-07-30 17:06:24 +01:00
Nekotekina e1042bc631 Get rid of "module" keyword
Workaround some intellisense problems.
2020-05-06 18:20:11 +03:00
Nekotekina fc68c508c8 LLVM DSL: fix FNeg pattern matching 2020-05-01 22:00:57 +03:00
Nekotekina a53d0d50b3 SPU LLVM: add alternative ROTQBY implementation
Used if SSSE3 is not available (exec_rotqby).
2020-04-04 21:38:40 +03:00
Nekotekina e4a81b1d13 Move Log.h to util/logs.hpp 2020-03-07 12:29:23 +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
JohnHolmesII 479a64c4e8 Remove some inline compiler pragmas 2020-02-23 09:38:04 +03:00
Nekotekina 244e74ebe2 Try to ignore some annoying warning (seems CIB) 2020-02-17 20:56:03 +03:00
Eladash c9b0f0e734 SPU: Fix FREST 2020-01-16 23:42:50 +03:00
Nekotekina 068450d4fe CPUTranslator: detect FMA feature 2019-12-20 21:11:07 +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 db4e201fee SPU LLVM: use updateGlobalMapping instead of addGlobalMapping
...Where appropriate.
Fix to incorrect addGlobalMapping usage.
Also use clearAllGlobalMappings at compilation start.
2019-11-17 22:15:59 +03:00
Nekotekina 6e19881b82 Update LLVM (10) 2019-10-23 16:01:14 +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
Lassi Hämäläinen e9e87b8bd9 Add missing #includes to header files
- Multiple header files where missing #includes to other headers that
  where used in the header. Correct header was included in correct
  order in source files which caused everything to compile.
- Added missing #includes so header files correctly include all their
  dependencies and fixes problems with IDEs being unable to parse
  headers correctly due to missing symbols
2019-06-25 17:11:10 +03:00
Nekotekina ceaa669494 LLVM DSL: change array syntax again
I probably misunderstand something.
2019-05-19 17:46:55 +03:00
Nekotekina b2d0ca83fb LLVM DSL: simplify value_t template for array 2019-05-15 15:17:36 +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 716737ecf2 LLVM DSL: expression matching (alpha)
Implement remaining instructions.
Implement match_expr method.
Implement helper methods.
2019-04-30 14:33:27 +03:00
Nekotekina 2ade3c594c LLVM DSL: expression matching (preview 2)
Implement more instructions.
2019-04-25 03:33:18 +03:00
Nekotekina aca61fdcf9 LLVM DSL: implement expression matching (preview)
Only literal match for binary ops implemented.
2019-04-24 23:55:41 +03:00
Nekotekina 8754bbd444 SPU LLVM: add match_vr<> template
Returns reg value only if type is compatible, avoiding bitcast.
2019-04-24 23:55:41 +03:00
Nekotekina 3e0b45719d LLVM DSL: rewrite zshuffle, shuffle2, build
Add llvm_const_vector template.
2019-04-24 23:55:41 +03:00
Nekotekina b02503963e LLVM DSL: rewrite splat, fsplat, vsplat
Add llvm_const_float and llvm_splat templates.
2019-04-24 23:55:41 +03:00
Nekotekina c83e65f29e LLVM DSL: rewrite extract and insert 2019-04-24 23:55:41 +03:00
Nekotekina 2eac59f59a LLVM DSL: rewrite add_sat and sub_sat
Simplify constant folding logic
2019-04-24 23:55:41 +03:00
Nekotekina ac473eb400 Rewrite cpu_translator::rol, add fshl and fshr
Use new funnel shift intrinsics
2019-04-24 23:55:41 +03:00
Nekotekina 42448cf3e5 Remove cpu_translator::scarry, cpu_translator::merge 2019-04-24 23:55:41 +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
Nekotekina 3925cb59ac LLVM DSL: fix pointer type traits
Clear and match 'void' type
2019-04-24 23:55:41 +03:00
Nekotekina dc9118ef50 LLVM DSL refactoring
Properly forward value categories in expression structs.
Simplify SFINAE tests (is_llvm_expr, llvm_common_t) in global operators.
Add llvm_const_int and remove llvm_add_const, llvm_sub_const, etc.
Add llvm_ord and llvm_uno for FP comparison via >=< operators.
Replace cpu_translator::fcmp with fcmp_ord and fcmp_uno.
2019-04-24 23:55:41 +03:00
Nekotekina d873802b9c Use LLVM 9
Use new add/sub with saturation intrinsics
2019-03-30 01:36:48 +03:00
Nekotekina 71b88cdc82 New SPU interpreter (SPU fast)
Use LLVM to build SPU interpreter.
Simplify interpreter loop.
2019-03-27 20:33:44 +03:00
scribam 3072571a4f cpu: use correct type when defining llvm value is_int constexpr 2018-09-10 19:59:37 +03:00
Nekotekina fdd4f03b93 SPU LLVM: improve xfloat precision
Use doubles for intermediate representation
Add option "Accurate xfloat" to enable
2018-08-12 15:42:47 +03:00
Nekotekina 89fe3705a4 Remove cpu_translator::ucarry<> 2018-07-21 12:18:07 +03:00
Nekotekina a0bf103e8b Implement cpu_translator::pshufb<>()
Remove spu_translator::pshufb<>()
Improve PSHUFB emulation (pre-SSSE3)
Emit static shufflevector for the constant mask
PPU: Inline VPERM instruction
2018-07-06 00:33:52 +03:00
Nekotekina c86dc133cf Rewrite cpu_translator::avg() 2018-07-05 22:26:35 +03:00
Nekotekina 88d0316aad Update cpu_translator
Add get_const_vector<v128>()
Add make_const_vector<v128>()
Add i2 and i4 types
Add build<>() for vector constants
Fix comparisons, allow EQ/NE for bool/char/i2/i4 types
2018-07-05 22:26:35 +03:00