Commit Graph

66 Commits

Author SHA1 Message Date
chss95cs@gmail.com
327cc9eff5 drastically reduce size of final generated code for rlwinm by adding special paths for rotations of 0, masks that discard the rotated bits and using And w/ UINT_MAX instead of truncate/zero extend
Add special case to TYPE_INT64's EmitAnd for UINT_MAX mask. Do mov32 to 32 if detected to take advantage of implicit zero xt/reg renaming

Add helper function for skipping assignment defs in instr.
Add helper function for checking if an opcode is binary value type
Add several new optimizations to simplificationpass, plus weak NZM calculation code (better full evaluation of Z/NZ will be done later) .
 List of optimizations:
  If a value is anded with a bitmask that it was already masked against, reuse the old value (this cuts out most FPSCR update garbage, although it does cause a local variable to be allocated for the masked FPSCR and it still repeatedly stores the masked value to the context)
  If masking a value that was or'ed against another check whether our mask only considers bits from one value or another. if so, change the operand to the OR input that actually matters
  If the only usage of a rotate left's output is an AND against a mask that discards the bits that were rotated in change the opcode to SHIFT_LEFT
  If masking against all ones, become an assign.
  If XOR or OR against 0, become an assign (additional FPSCR codegen cleanup)
  If XOR against all ones, become a NOT
Adding a direct CPUID check to x64_emitter for lzcnt, the version of xbyak we are using is skipping checking for lzcnt on all non-intel cpus, meaning we are generating the much slower bitscan path for AMD cpus.
2022-06-25 09:58:13 -07:00
Gliniak
0b183a3582 Merge branch 'chris_cpu_changes' of https://github.com/Gliniak/xenia.git into canary_experimental 2022-06-17 14:04:58 +02:00
chss95cs@gmail.com
3675b3860a Add constant folding for OPCODE_ROTATE_LEFT 2022-06-17 11:12:49 +02:00
Gliniak
0f2a7105b9 [CPU] Added constant propagation pass for: OPCODE_AND_NOT 2022-03-11 08:54:01 +01:00
Joel Linn
86722be9ca [Base] Make Arena alignment aware
- Add align parameter
- Templated Alloc() implicitly aligns type correctly
- Rewind may leak padding that was added due to alignment
2021-06-02 22:28:43 -05:00
gibbed
5bf0b34445 C++17ification.
C++17ification!

- Filesystem interaction now uses std::filesystem::path.
- Usage of const char*, std::string have been changed to
  std::string_view where appropriate.
- Usage of printf-style functions changed to use fmt.
2020-04-07 16:09:41 -05:00
Joel Linn
64539621b4 Replace binary_function by plain function.
- Deprecated in C++11
- Removed in C++17
2020-02-20 06:44:09 -06:00
Jonathan Goyvaerts
c1af632562 Replace all gflag implementations with cvar implementations 2019-08-03 02:34:07 +02:00
gibbed
5fbcb8991e [JIT] Run the SimplificationPass/ConstantPropagationPass until there are no changes. 2018-11-23 12:01:10 -06:00
gibbed
7d07720de1 [JIT] Zero constant propagation for OPCODE_SHL/OPCODE_SHR. 2018-11-23 08:02:09 -06:00
gibbed
4c04a9383a [JIT] Fix constant propagation for OPCODE_SELECT. 2018-11-23 07:52:14 -06:00
Margen67
896ac4a682 Update documentation.
- Convert http to https, provide archive link when possible.
- Made CPU-JIT.png more readable on dark themes;
Added a white background so there isn't black text on a black
background.
2018-11-22 09:20:09 -06:00
gibbed
3ced6c5cf2 [CPU] Add constant VectorAverage. 2018-11-18 08:13:37 -06:00
DrChat
894bbf9e26 [JIT] Fix incorrect definition for constant VectorConvertX2X 2018-03-02 19:03:48 -06:00
DrChat
49866e970b [JIT] VectorConvertX2X unsigned support 2018-03-02 16:34:57 -06:00
DrChat
6fd75cea91 [CPU] Handle constant multiply in fmadd/fmsub in constant propagation pass 2018-03-01 20:04:56 -06:00
DrChat
e54c24e150 [JIT] New opcodes: OPCODE_LOAD_OFFSET and OPCODE_STORE_OFFSET
These take full advantage of x86 addressing, and eliminate extra add operations.
2018-02-14 16:26:49 -06:00
DrChat
aaf281351d Format all code with new clang-format 2017-12-14 20:44:43 -06:00
scribam
b6e7e66fbe Fix travis LINT 2017-09-20 23:29:39 +02:00
Doug Johnson
48a2435bde Add header dependencies that prevented linux build
There were several files with dependancies on vector and cmath that
caused compiler errors under linux. In addition, there was a printf
formatting error that threw a compiler error as well
2017-07-11 11:47:24 -06:00
DrChat
f012845cb6 JIT: Propagate mul/div by constant one 2017-03-16 18:49:55 -05:00
Vlad Ivanov
f0ba717142 Fix a bunch of missing cmath includes
...as well as missing std:: namespace specifiers
2017-02-07 20:26:08 +03:00
Dr. Chat
a72f1d949f Constant propagation for vector SGT/UGE/UGT
Constant rounding (and fixed vec128 rounding only doing x)
2016-07-25 11:57:14 -05:00
Dr. Chat
18ff97e6b6 OPCODE_IS_NAN 2016-07-11 20:44:12 -05:00
Dr. Chat
3d1d4dea47 OPCODE_DOT_PRODUCT_4 constant propagation 2016-06-28 19:39:22 -05:00
Dr. Chat
f2ad6b8cb8 OPCODE_RECIP 2016-06-26 13:03:42 -05:00
gibbed
53e37c3167 Constant propogation for DOT_PRODUCT_3. 2016-06-20 13:30:19 -05:00
Dr. Chat
0ef16b10e2 Constant Propagation for OPCODE_VECTOR_ADD 2016-06-12 21:41:02 -05:00
Dr. Chat
0771eea0b3 Change comments to comply with local regulations. 2016-01-13 19:41:15 -06:00
Dr. Chat
3ccb2a978d Propagate vector constants. 2016-01-13 01:40:44 -06:00
Ben Vanik
15816327b4 Renaming xe::cpu::frontend to xe::cpu::ppc. 2015-12-14 21:17:55 -08:00
Ben Vanik
9273359cdd Removing vestigial ContextInfo. 2015-12-14 20:57:14 -08:00
Dr. Chat
bc1e7684ca Pass rounding mode from i->flags for OPCODE_CONVERT 2015-12-02 14:03:15 -06:00
Dr. Chat
525d62d437 constant OPCODE_CONVERT and more cases for OPCODE_LOAD 2015-12-01 19:51:28 -06:00
Dr. Chat
873016f06f Fix double-swap in constant load 2015-12-01 19:03:51 -06:00
Ben Vanik
4af6c41740 Moving profiling.h to base - UI could be separated for cleanliness. 2015-11-07 12:31:07 -08:00
Ben Vanik
3c50b6739a Capturing guest/host context and showing registers in debugger. 2015-08-29 08:08:54 -07:00
Ben Vanik
a92566dfc5 More style. 2015-08-07 21:29:03 -07:00
Ben Vanik
14beb27ebc xb style. 2015-08-07 07:56:57 -07:00
Ben Vanik
5e08889d93 More style cleanup. 2015-08-06 20:17:01 -07:00
Ben Vanik
eaa1a8ee3a Refactoring SymbolInfo/FunctionInfo/Function into Symbol/Function. 2015-08-05 21:50:02 -07:00
Ben Vanik
90c248146e --inline_mmio_access to allow turning it off. 2015-08-03 19:07:34 -07:00
Ben Vanik
91d7acf59e Fixing some particularly bad /W4. 2015-07-18 23:04:21 -07:00
Ben Vanik
ecd4af10c9 Fixing some clang warnings/errors. 2015-07-15 23:26:58 -07:00
Ben Vanik
31dab70a3a Adding some docs on CPU optimizations/potential work. 2015-07-13 18:20:38 -07:00
Drew DeVault
a064ba053e Add missing includes for cstring 2015-06-16 23:16:18 -06:00
Ben Vanik
2a6ada2a3c Optimization to merge LOAD+SWAP and SWAP+STORE into flagged opcodes. 2015-06-15 18:59:29 -07:00
Ben Vanik
889f29c18a Fixing CFG to remove unreachable blocks and properly maintain dominators. 2015-06-07 15:14:14 -07:00
Ben Vanik
6edf4f898f Gracefully skipping noaccess constant loads. 2015-06-06 22:56:53 -07:00
Ben Vanik
429698c2ec Replacing DidCarry with manual calculation and fixing compares. 2015-06-06 15:24:46 -07:00