Commit Graph

896 Commits

Author SHA1 Message Date
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
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
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
22e7500f63 [CPU] Handle NaN in fctidxx, fctiwxx. 2018-11-20 23:21:38 -06:00
gibbed
394105d359 [CPU/Kernel] Cleanup and rework of how kernel exports are declared. 2018-11-20 13:03:17 -06:00
Rick Gibbed
c65ee2aa48 Merge pull request #1226 from chris-hawley/master
[JIT] stmw/lmw
2018-11-20 08:43:26 -06:00
Dr. Chat
95701f188d [x64] Dynamically link to growable function tables 2018-11-18 21:21:36 -06:00
Dr. Chat
c9797dde2a [CPU] Fix switch variable scoping 2018-11-18 11:35:23 -06:00
gibbed
4436616e6d [x64] Use constant a bit earlier in VECTOR_SHL_V128. 2018-11-18 08:17:04 -06: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
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
Dr. Chat
69af4a21ac [x64] Fill unwind reservation info bytes with 0xCC as well 2018-11-17 11:04:25 -06:00
emoose
ab53cf2a82 [CPU] Fix some compressed XEXs decompressing past the image size 2018-11-05 19:47:18 +00:00
emoose
bbb5c938ec [CPU] Fix XexModule::FindSaveRest not finding functions properly 2018-11-01 15:50:56 +00: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
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