Commit Graph

1088 Commits

Author SHA1 Message Date
Triang3l 741b5ae2ec [Memory] Add HostToGuestVirtual and use it in a couple of places 2019-08-13 23:49:49 +03:00
Triang3l f1b9e1afce [CPU] Remove unused access violation handler variables 2019-08-13 00:06:29 +03:00
gibbed b2f62b1982 Clean up cvars (rename, recategorize). 2019-08-03 23:46:03 -05:00
Triang3l d20c2fa9da [Memory/Vulkan] Move old memory watches to the Vulkan backend 2019-08-03 21:06:59 +03:00
Triang3l 352f12f92e [D3D12] Switch from gflags to cvars 2019-08-03 16:53:23 +03:00
Jonathan Goyvaerts 81fe22f1c8 Get rid of gflags alltogether 2019-08-03 02:34:19 +02:00
Jonathan Goyvaerts c1af632562 Replace all gflag implementations with cvar implementations 2019-08-03 02:34:07 +02:00
Triang3l e071ca852c Merge branch 'master' into d3d12 2019-08-02 21:50:43 +03:00
Rick Gibbed 372928cd57
Merge pull request #1387 from Margen67/update_capstone
Update Capstone to latest stable (4.0.1).
2019-08-02 11:09:02 -05:00
Triang3l 4aceeb73c4 [Memory] Move new watches to heap-aware Memory from MMIOHandler 2019-07-30 08:00:20 +03:00
Triang3l 211f59740c Merge branch 'master' into d3d12 2019-07-21 22:02:12 +03:00
Triang3l bc2eaf9b64 [CPU] VectorAverage CPU-independent constant propagation 2019-07-21 22:01:24 +03:00
Triang3l 547345b12d Merge branch 'master' into d3d12 2019-07-21 18:31:06 +03:00
Triang3l ab664e38a0
Merge pull request #1406 from Gliniak/vsvgsb
Added support for Altivec: vavgsb
2019-07-21 18:30:03 +03:00
Triang3l 7648e45661 Merge branch 'master' into d3d12 2019-07-20 22:05:34 +03:00
Triang3l 8c00aea5ff [CPU] vpkd3d VPACK_NORMPACKED64 2019-07-20 22:04:37 +03:00
Triang3l 0488766452 Merge branch 'master' into d3d12 2019-07-19 23:13:38 +03:00
Triang3l 26c24b4726 [CPU] Move saturating add/sub to base/math.h 2019-07-19 23:12:11 +03:00
Triang3l 808d6d6025 Merge branch 'master' into d3d12 2019-07-19 08:22:59 +03:00
Triang3l 2b411f4c8b [CPU] Saturating VectorSub: fix typo in last commit 2019-07-19 08:22:30 +03:00
Triang3l 2c2808ce00 Merge branch 'master' into d3d12 2019-07-19 08:19:03 +03:00
Triang3l f14f44e729 [CPU] Saturating VectorAdd/Sub of constants without DID_SATURATE yet 2019-07-19 08:17:55 +03:00
Radosław Gliński 53eb95d33c Added support for Altivec: vavgsb
Also little size adjustments for vavgsh
2019-07-18 21:22:42 +02:00
gibbed e024cbc3f0 Merge remote-tracking branch 'origin/master' into d3d12 2019-07-18 12:33:52 -05:00
gibbed e14639c6c0 [CPU] Fix lzx_decompress misuse of xe::bit_count. Fixes #1402. 2019-07-18 12:33:16 -05:00
gibbed 1e5fa61030 Merge remote-tracking branch 'origin/master' into d3d12 2019-07-17 17:56:48 -05:00
gibbed c213f7d7a3 [CPU] Properly clear LZX window. 2019-07-17 17:53:59 -05:00
gibbed 29665ae79c [CPU] Minor LZX code cleanup. 2019-07-17 17:51:36 -05:00
emoose 71780838f0
[CPU] Use window size for LZX ref_data_size 2019-07-17 22:53:39 +01:00
Margen67 aea0d8d6b3 [third_party] Update capstone to latest stable 2019-06-24 23:15:28 -07:00
Triang3l f7ea93148a Merge branch 'master' into d3d12 2019-05-25 23:03:21 +03:00
gibbed 8afb93e2d9 [PPC] Fix trailing comment in ppc_opcode_disasm.h. 2019-05-13 00:59:40 -05:00
gibbed 9d7058ac96 [PPC] Shuffle code around to make it cleaner to modify by hand.
- [PPC] Rename ppc_opcode_lookup.cc, ppc_opcode_table.cc to have a _gen
suffix to make it more obvious about their autogenerated nature.
- [PPC] Move autogenerated code from ppc_opcode_disasm.cc to
ppc_opcode_disasm_gen.cc.
- [PPC] Update ppc-table-gen to allow for blacklisting of certain
instructions that have custom disasm code.
2019-05-13 00:49:57 -05:00
eladash 67e3b1f453 [PPC] disasm: BC formatting improvements 2019-05-13 00:27:40 -05:00
gibbed fac37e7c50 Merge branch 'master' into d3d12 2019-05-01 21:00:21 -05:00
gibbed bc0ebcb26e - Clean up log level names, no need for LOG_LEVEL_ prefix when it is an
enum class.
- Clarify usage of log level in comment.
2019-04-30 17:41:27 -05:00
gibbed c965751911 Merge remote-tracking branch 'origin/master' into d3d12 2019-04-20 02:40:46 -05:00
gibbed 1145d57007 Undo main/wWinMain changes in preparation for new method
of doing a startup AVX check.

This reverts commit 4030cff3ec.
2019-04-20 02:32:45 -05:00
Triang3l 40ffba97d9 Merge branch 'master' into d3d12 2019-04-19 15:32:10 +03:00
gibbed 4030cff3ec - Move main, wWinMain entrypoints to their own file.
- Fix startup AVX checks.
2019-04-18 16:57:42 -05:00
Triang3l ec92d46480 Merge branch 'master' into d3d12 2019-04-18 17:54:57 +03:00
gibbed 593a871c84 [x64] Use vmovaps instead of movaps in emitted function prolog/epilog. 2019-04-18 09:36:06 -05:00
Triang3l eaefc3862f Merge branch 'master' into d3d12 2019-01-24 17:46:06 +03:00
Triang3l 4ae9266f13 [CPU] Fix vpkd3d half4 component order 2019-01-24 17:45:41 +03:00
Triang3l 7d7a539aee Merge branch 'master' into d3d12 2019-01-13 19:07:06 +03:00
Triang3l 8e5a11aeb4 [CPU] Add D3DCOLOR vpkd3d test with 0xFFFFFFFF 2019-01-13 19:06:14 +03:00
Triang3l 58d9c6f33f Merge branch 'master' into d3d12 2019-01-13 17:29:44 +03:00
Triang3l 949b05f517 [CPU] Fix saturation in D3DCOLOR vpkd3d 2019-01-13 17:29:06 +03:00
Triang3l 0e9428f1bc Merge branch 'master' into d3d12 2019-01-08 01:40:08 +03:00
Triang3l ae6fd98c3c [CPU] Ignore upper bits of shift amount in srdx/srwx 2019-01-08 01:39:21 +03:00
Triang3l 9427667a27 [D3D12] Experimental 2x resolution scale 2018-12-06 10:38:13 +03:00
Triang3l b56f8f9c7c Merge branch 'master' into d3d12 2018-11-26 20:45:52 +03:00
gibbed e7d77f4780 Clarify AVX requirement error message. 2018-11-26 10:33:22 -06:00
Triang3l beebed4ca2 Merge branch 'master' into d3d12 2018-11-25 12:44:30 +03:00
gibbed 9162bc2af9 [CPU] Fix Travis whining. 2018-11-24 16:21:06 -06:00
gibbed 5679b0f0c7 [CPU] Fix XEX2 delta patching. 2018-11-24 15:16:39 -06:00
gibbed 77f9e1516e [CPU] Minor cleanup in LZX. 2018-11-24 15:16:02 -06:00
gibbed 5f764fc752 [CPU] Move LZX code to its own files. 2018-11-24 15:02:03 -06:00
gibbed dd3a049b23 [CPU] Oops. 2018-11-24 15:00:00 -06:00
Triang3l 5c1efe7b9a Merge branch 'master' into d3d12 2018-11-24 16:26:27 +03:00
gibbed 207589e5a1 [CPU/Kernel] Correct parsing of XEX_HEADER_IMPORT_LIBRARIES. 2018-11-24 04:05:41 -06:00
Dr. Chat b3d509eb01 [x64] Swap to using anchor variables instead of dummy function calls 2018-11-23 18:02:04 -06:00
Dr. Chat df964015a4 [x64] Fix improper use of compare_exchange_strong when adjusting code commit mark 2018-11-23 18:02:04 -06:00
Dr. Chat 384ec98a42 [x64] Allow the JIT to use volatile registers 2018-11-23 18:02:04 -06:00
Dr. Chat b57bb74965 [x64] Change the parameters to host_to_guest_thunk
Shuffle some code around in x64_backend.cc
Add GetNativeParam to avoid hardcoding parameters
2018-11-23 18:02:04 -06:00
Dr. Chat c451fda819 [x64] Template-ize a few vector emulation functions 2018-11-23 18:02:03 -06:00
Dr. Chat 4571e8207a [x64] Minor cleanups in emitter 2018-11-23 18:02:03 -06:00
Dr. Chat b2f9d54e7e [x64] Factor out memory handling code 2018-11-23 18:02:03 -06:00
Dr. Chat bb74114cab [x64] Factor out control code 2018-11-23 18:02:03 -06:00
Dr. Chat c318009733 [x64] Factor out vector handling code 2018-11-23 18:02:03 -06:00
Dr. Chat 6861cce492 [x64] Factor out a lot of the opcode handling code 2018-11-23 18:02:02 -06:00
Dr. Chat 696c3cd439 [x64] Remove most of RegisterSequences 2018-11-23 18:02:02 -06:00
gibbed d87ae26895 [CI] Fix mspack linking even more. 2018-11-23 17:58:38 -06:00
gibbed 7226c9e047 Update mspack, add to premake, and fix missing license. Fixes #1252. 2018-11-23 15:32:55 -06:00
gibbed 4c53bc5c9a [x64] Fix Travis whining. 2018-11-23 12:03:09 -06:00
gibbed 5fbcb8991e [JIT] Run the SimplificationPass/ConstantPropagationPass until there are no changes. 2018-11-23 12:01:10 -06:00
gibbed b121f45c7f [JIT] Assert that other is constant in set_from. 2018-11-23 10:46:27 -06:00
Triang3l ff363d85be Merge branch 'master' into d3d12 2018-11-23 19:08:43 +03:00
gibbed 996093e499 [x64] Support constant src1 for Int32 VECTOR_SHL_V128/VECTOR_SHR_V128. 2018-11-23 09:33:30 -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
gibbed 94284ea9aa [CPU] Fix null termination in HIRBuilder::CommentFormat. 2018-11-23 07:50:42 -06:00
Triang3l da280347c4 Merge branch 'master' into d3d12 2018-11-22 21:01:05 +03: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
Triang3l e6bd8f37aa Merge branch 'master' into d3d12 2018-11-21 13:17:18 +03:00
gibbed 22e7500f63 [CPU] Handle NaN in fctidxx, fctiwxx. 2018-11-20 23:21:38 -06:00
Triang3l a6b3bddf13 Merge branch 'master' into d3d12 2018-11-20 22:04:55 +03:00
gibbed 394105d359 [CPU/Kernel] Cleanup and rework of how kernel exports are declared. 2018-11-20 13:03:17 -06:00
Triang3l 3139e2d33b Merge branch 'master' into d3d12 2018-11-20 20:22:59 +03:00
Rick Gibbed c65ee2aa48
Merge pull request #1226 from chris-hawley/master
[JIT] stmw/lmw
2018-11-20 08:43:26 -06:00
Triang3l e2122379b1 Merge branch 'master' of github.com:xenia-project/xenia into d3d12 2018-11-19 12:51:01 +03:00
Dr. Chat 95701f188d [x64] Dynamically link to growable function tables 2018-11-18 21:21:36 -06:00
Triang3l c9fdb72b72 Merge branch 'master' of github.com:xenia-project/xenia into d3d12 2018-11-18 20:44:47 +03:00
Dr. Chat c9797dde2a [CPU] Fix switch variable scoping 2018-11-18 11:35:23 -06:00
Triang3l 0c1431df46 Merge branch 'master' into d3d12 2018-11-18 17:17:45 +03:00
gibbed 4436616e6d [x64] Use constant a bit earlier in VECTOR_SHL_V128. 2018-11-18 08:17:04 -06:00
Triang3l 44e8b1c91b Merge branch 'master' into d3d12 2018-11-18 17:16:16 +03:00
gibbed 44f194be35 [x64] Fix constant access in VECTOR_SHL_V128. 2018-11-18 08:13:37 -06:00
gibbed 3ced6c5cf2 [CPU] Add constant VectorAverage. 2018-11-18 08:13:37 -06:00
Triang3l 251ce2af6b Merge branch 'master' into d3d12 2018-11-18 12:13:26 +03:00
NPCompete da66c68bf6 [CPU] Made xe::cpu::StackWalker destructor virtual since it is an abstract class. 2018-11-17 14:50:30 -08:00
Dr. Chat aa14741e74 [x64] Fix unwind info bug; Cleanup win code cache 2018-11-17 14:40:25 -06:00
Triang3l 55fa9e6917 Merge branch 'master' into d3d12 2018-11-17 20:06:55 +03:00
Dr. Chat 69af4a21ac [x64] Fill unwind reservation info bytes with 0xCC as well 2018-11-17 11:04:25 -06:00
Triang3l 1f33c221a2 Merge branch 'master' into d3d12 2018-11-10 11:47:13 +03:00
emoose ab53cf2a82 [CPU] Fix some compressed XEXs decompressing past the image size 2018-11-05 19:47:18 +00:00
Triang3l d55a2a586f Merge branch 'master' into d3d12 2018-11-02 09:30:53 +03:00
emoose bbb5c938ec [CPU] Fix XexModule::FindSaveRest not finding functions properly 2018-11-01 15:50:56 +00:00
Triang3l c7befee395 Merge branch 'master' into d3d12 2018-10-28 20:31:49 +03:00
Dr. Chat 7443b7e61f [CPU] Rename ImportLibrary fields to follow naming conventions 2018-10-28 09:41:31 -05:00
emoose 6e74ba93d6 [CPU] Add support for delta patches using *_offset fields 2018-10-22 12:26:14 +01:00
emoose d2fd109af3 [CPU] Add more asserts for XEXP descriptor (+ log a warning) 2018-10-20 05:08:14 +01:00
emoose 265903fe66 [CPU] Add XEXP support to XexModule, if XEXP is in same folder as XEX
This was a headache to work out, big thanks to the lack of documentation on .xexp files... a ton of guesswork was involved here but luckily it turned out well.

I did have to make some pretty major changes to the way XEX files are loaded though.
Previously it'd just load everything in one go: XEX headers -> decrypt/decompress data -> load imports/symbols -> set loader data table entries, etc...

Now it's changed to something like this:
- Load base XEX headers + decrypted/decompressed image data, return X_STATUS_PENDING
- In the LoadFromFile call used to load the XEX, search for XEXP patch file (only .xexp in same folder atm)
- If patch exists: load XEXP, decrypt headers/data, apply patch to base XEX, dispose of XEXP
- Finish XEX load via LoadXexContinue() (handles imports/symbols/loader data...)

This saves us from needing to reset the imports/function/symbol stuff after patching (since all the XEX code will be a lot different), but I'm not really sure if I went about it the best way.
2018-10-20 04:36:21 +01:00
emoose 0b7f7e1657 [CPU] Move XEX2 code into XexModule class, autodetect XEX key
Code is mainly just copy/pasted from kernel/util/xex2.cc, I've tried fixing it up to work better in a class, but there's probably some things I missed.

Also includes some minor improvements to the XEX loader, like being able to try both XEX keys (retail/devkit) automatically, and some fixes to how the base address is determined.

(Previously there was code that would get base address from optional header, code that'd get it from xex_security_info, code that'd use a stored base address value...
Now everything reads it from a single stored value instead, which is set either from the xex_security_info, or if it exists from the optional header instead.
Maybe this can help improve compatibility with any weird XEX's that don't have a base address optional header?)

Compressed XEX loader also has some extra checks to make sure the compressed data hash matches what's expected.
Might increase loading times by a fraction, but could save reports from people unknowingly using corrupt XEXs.
(still no checks for non-compressed data though, maybe need to compare data with xex_security_info->ImageHash?)
2018-10-20 04:18:18 +01:00
Christian Hawley add23849bf [CPU] Implement lmw and stmw instructions 2018-10-14 13:57:45 -04:00
Triang3l 6e36101b42 [D3D12] Experimental write watch implementation for shared memory 2018-09-24 23:18:16 +03:00
Triang3l db625892ea [D3D12] Shared memory typo fix and improvements 2018-08-01 01:09:51 +03:00
Triang3l 4f7edff19d [D3D12] SHM: Watches prototype, some uploading 2018-07-26 22:52:26 +03:00
Triang3l dd19701dc4 [CPU] Unify constant operand checks in pack/unpack 2018-06-18 13:55:46 +03:00
Triang3l c89cc6a229 [CPU] vupkd3d: NaN on negative overflow and tests 2018-06-11 21:34:13 +03:00
Triang3l 0378f532ab [CPU] Fix W in 2101010 vupkd3d and revert untested saturation 2018-06-11 17:22:15 +03:00
Triang3l 06fcdef968 [CPU] Bring back saturation in D3DCOLOR vpkd3d128 2018-05-31 16:17:27 +03:00
Triang3l d61aff4389 [CPU] v(u)pkd3d128: Support UINT_2101010 and don't saturate D3DCOLOR
Fix broken mesh polygons in the Call of Duty series. Also remove saturation of D3DCOLOR when packing because values near 3 may be accepted, while unpacking D3DCOLOR gives values near 1.
2018-05-31 14:42:11 +03:00
gibbed 452c58149a [CPU] Some extra srw tests. 2018-05-22 05:56:20 -05:00
Dr. Chat 198cc9b9b9 [CPU] Print a message and crash if the CPU does not support AVX. 2018-05-03 22:12:36 -05:00
DrChat 14abe1a407 Fixup 360 support 2018-04-03 19:02:49 -05:00
DrChat 157c7780af [JIT] Add V128 ADD/SUB (fixes #1095) 2018-03-03 18:24:57 -06:00
DrChat 1c1fdb4ccd [JIT] Properly mask NaNs in vctsxs 2018-03-03 14:06:45 -06:00
DrChat 894bbf9e26 [JIT] Fix incorrect definition for constant VectorConvertX2X 2018-03-02 19:03:48 -06:00
DrChat 3a8f8f2ecb [JIT] Fix OPCODE_SELECT V128 with certain combinations of constants 2018-03-02 18:56:28 -06:00
DrChat 2af0a3c2f4 [JIT] Mask extraction constants in Value::Extract 2018-03-02 18:55:52 -06:00
DrChat 49866e970b [JIT] VectorConvertX2X unsigned support 2018-03-02 16:34:57 -06:00
DrChat fd0d2185ef [JIT] Full support for vcfux 2018-03-02 15:11:29 -06:00
DrChat b0b920c040 Linting. 2018-03-02 12:14:09 -06:00
DrChat 6c97dbaf81 [JIT] Simplify VECTOR_ADD/SUB i32 with saturate 2018-03-02 11:48:19 -06:00
DrChat 131fcd1320 [JIT] Kill a couple instructions in VECTOR_CONVERT_F2I 2018-03-02 11:41:04 -06:00
DrChat 04d20e33a5 [JIT] Add another test case to vctuxs 2018-03-02 00:05:43 -06:00
DrChat 0577b6c9be [JIT] Full vctuxs support 2018-03-01 23:49:44 -06:00
DrChat 4766a5ec24 [JIT] Add FIXME on constant Vector F2I (saturation unsupported) 2018-03-01 21:15:54 -06:00
DrChat 6fd75cea91 [CPU] Handle constant multiply in fmadd/fmsub in constant propagation pass 2018-03-01 20:04:56 -06:00
DrChat db53559611 Merge branch 'master' 2018-02-16 16:34:17 -06:00
DrChat 43f9cebb0c [JIT] Rewrite CNTLZ and remove one branch 2018-02-16 12:51:39 -06:00
DrChat ec501a32c6 [JIT] Apply the same ZeroExtend/Truncate to rlwimix and rlwnmx 2018-02-14 22:05:54 -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 1de598e4ce [JIT] Comment the offsets in PPCContext 2018-02-14 16:22:14 -06:00
DrChat 7818cdab60 [CPU] Check for RawModule memory allocation success 2018-02-14 16:21:16 -06:00
DrChat 02b5a07bc9 [JIT] rlwinmx: Use Truncate/ZeroExtend instead of And 0xFFFFFFFF 2018-02-14 13:50:57 -06:00
DrChat 1d0b290c3d [JIT] Remove all calls to ReloadMembase / ReloadContext (rcx/rdx free now) 2018-02-13 13:33:39 -06:00
DrChat e2bbae3896 [JIT] Don't bother using a temp for constant addresses < 0x80000000 2018-02-13 13:09:40 -06:00
DrChat a1677d34e1 [CPU] MMIOHandler IsRangeWatched now returns true if the entire range is watched. 2018-02-09 19:23:24 -06:00