Commit Graph

35418 Commits

Author SHA1 Message Date
JosJuice
feefc17b02 JitArm64: divwx - Optimize comparisons to 0x80000000 2021-08-26 15:04:56 +02:00
JosJuice
91b112b984 JitArm64: divwx - Optimize division by 2
...and let's optimize a divisor of 2 ever so slightly for
good measure. Most GameCube games seem to hit this on launch.
2021-08-26 15:04:56 +02:00
JosJuice
9889e7eb33 JitArm64: divwx - Optimize power-of-two divisors
Power-of-two divisors can be done more elegantly, so handle them
separately.
2021-08-26 15:04:55 +02:00
JosJuice
eb8581c26d JitArm64: divwx - Optimize constant divisor
Optimize division by a constant into multiplication. This method is
also used by GCC and LLVM.

We also add optimized paths for divisors 0, 1, and -1, because they
don't work using this method. They don't occur very often, but are
necessary for correctness.
2021-08-26 15:04:51 +02:00
JosJuice
f8e97f5a8a JitArm64: divwx - Special case dividend == 0
Zero divided by any number is still zero. For whatever reason,
this case shows up frequently too.
2021-08-26 14:50:01 +02:00
JosJuice
09cdb076a3 JitArm64: divwx - Optimize constant dividend
When the dividend is known at compile time, we can eliminate some
of the branching and precompute the result for the overflow case.
2021-08-26 14:50:01 +02:00
Tilka
559de262a1
Merge pull request #10059 from JosJuice/wia-segment-t
docs: Fix incorrect reference to wia_exception_t
2021-08-26 10:31:33 +01:00
JosJuice
b3d57eb25f docs: Fix incorrect reference to wia_exception_t 2021-08-26 11:24:56 +02:00
Mai M
7688db3cd3
Merge pull request #10047 from Dentomologist/remove_windows_help_buttons
DolphinQt: Remove Windows dialog help buttons
2021-08-24 08:34:31 -04:00
Mai M
922f53e16e
Merge pull request #10049 from JosJuice/jitarm64-fault-to-handler
JitArm64: Make HandleFastmemFault less unsafe
2021-08-24 08:33:58 -04:00
Mai M
19f8e39929
Merge pull request #10051 from Pokechu22/dsp-jit-revert-acs-extension
Revert "DSPJit: Sign-extend acS.h to 32 bits"
2021-08-24 08:33:32 -04:00
Markus Wick
757985d4c2
Merge pull request #10052 from JosJuice/jitarm64-sbtm-attempt-2
JitArm64: Indexed paired loadstores workaround, attempt 2
2021-08-23 19:09:29 +02:00
JosJuice
6b8d17ce57 Revert "JitArm64: Disable indexed paired loadstore instructions"
This reverts commit f70ddebb40.
2021-08-23 11:01:07 +02:00
JosJuice
3071a1d13b JitArm64: Indexed paired loadstores workaround, attempt 2
f70ddeb did not make the issue go away.
2021-08-23 10:46:28 +02:00
Pokechu22
1abaff758a Revert "DSPJit: Sign-extend acS.h to 32 bits"
This reverts commit dc2eab1778.
2021-08-22 18:44:24 -07:00
Tilka
bc10412d24
Merge pull request #10045 from Pokechu22/dsp-lle-sr64
DSPLLE: Carry and overflow fixes
2021-08-23 01:12:44 +01:00
Pokechu22
779cd479bc DSPLLE: NEG can set the carry and overflow flags 2021-08-22 17:07:44 -07:00
Pokechu22
3ee605d699 DSPJit: Rework overflow and carry handling 2021-08-22 17:07:44 -07:00
Pokechu22
4508ca6734 DSPInterpreter: Rework overflow and carry handling 2021-08-22 17:07:44 -07:00
Pokechu22
7cd1b2c4d1 DSPJit: Fix xA and xB 2021-08-22 17:07:44 -07:00
Pokechu22
a30a186d30 DSPInterpreter: Replace IsConditionA with IsConditionB
Although it's not clear what the xA and xB conditions are intended to do, the pattern indicates that xB is the regular version and xA is the inverted version, so for consistency, IsConditionB should be the main function.
2021-08-22 17:07:44 -07:00
Pokechu22
e5d130c4b3 DSPLLE: O is the mnemonic for overflow, not 0 2021-08-22 17:07:44 -07:00
Pokechu22
4865b322d0 DSPInterpreter: Improve CMPAR variable names 2021-08-22 17:07:43 -07:00
Pokechu22
dc2eab1778 DSPJit: Sign-extend acS.h to 32 bits
Thus, the 40-bit accumulator is treated as properly sign-extended when read as a 64-bit number.  This affects e.g. overflow detection.
2021-08-22 17:07:43 -07:00
Pokechu22
74440c468f DSPInterpreter: Sign-extend acS.h to 32 bits
Thus, the 40-bit accumulator is treated as properly sign-extended when read as a 64-bit number.  This affects e.g. overflow detection.
2021-08-22 17:07:43 -07:00
Pokechu22
105d8860fb DSPAnalyzer: Disable update SR analysis
It doesn't work right in all situations, including in the cond_test hardware test.  It could definitely be fixed, but it would be a hassle to do so.
2021-08-22 17:07:43 -07:00
Pokechu22
464575702b DSPSpy: Replace less_test with cond_test
This new test covers all conditions, and also tests overflow, carry, logical zero, and the behavior of NEG
2021-08-22 17:07:41 -07:00
Tilka
67dce9f35d
Merge pull request #10038 from Pokechu22/dsp-rti-srs
DSPLLE: Split SRS into SRS and SRSH and implement conditional variants of RTI
2021-08-23 01:02:45 +01:00
Mai M
c227023375
Merge pull request #10050 from JosJuice/jitarm64-disable-psq-x
JitArm64: Disable indexed paired loadstore instructions
2021-08-22 19:11:16 -04:00
JosJuice
f70ddebb40 JitArm64: Disable indexed paired loadstore instructions
Since the merge of b24b79e, we've gotten reports that the
following games are broken on JitArm64:

* Sonic Heroes
* The SpongeBob SquarePants Movie
* Astérix & Obélix XXL
* The Incredibles: Rise of the Underminer

Disabling the register cache avoids the issue, so the cause
of the bug might not actually have anything to do with the
newly implemented instructions. Nevertheless, I don't want
to ship a beta with this problem present, so I would like to
disable these instructions for the time being.
2021-08-22 22:16:02 +02:00
JosJuice
0cf8405126 JitArm64: Make HandleFastmemFault less unsafe
HandleFastmemFault works correctly when faults only happen in
expected locations, but it does some things that are rather
dangerous for faults in unexpected locations, like decrementing
an iterator without checking whether it's equal to begin.

This change cleans up the logic by making m_fault_to_handler's
key be the end of the fastmem region instead of the start.
2021-08-22 19:51:21 +02:00
Pokechu22
44129dda4c dsp_rom: Add version numbers and hashes to VerifyRoms and readme 2021-08-22 10:49:46 -07:00
Pokechu22
a5e2a0d973 dsp_rom: Remove illegal use of AX with SRS 2021-08-22 10:49:46 -07:00
Tillmann Karras
c881f4db22 dsp_rom: add pseudo code and fix small accuracy issues
Doesn't fix anything, hence not upstreaming this.
2021-08-22 10:49:46 -07:00
Pokechu22
d0b40528e5 dsp_rom: Fix readme eols and trailing whitespace 2021-08-22 10:49:46 -07:00
Pokechu22
9b1d370478 DSPLLE: Implement conditional variants of RTI 2021-08-22 10:49:46 -07:00
Pokechu22
f9e36bfa67 DSPLLE: Split SRS into SRS and SRSH
Hardware testing indicated that SRS uses a different list of registers than LRS (specifically, acS.h can be used with SRSH but not LRS, and SRS does not support AX registers, and there are 2 encodings that do nothing).
2021-08-22 10:49:46 -07:00
Pokechu22
51c26d82a5 DSPSpy: Require user to specify a test_main label
This makes the point where execution starts more obvious compared to a start_of_test label at the end of the include, and allows putting other functions at the start of the file.  This change also modifies the existing tests to build with this change.
2021-08-22 10:49:46 -07:00
Pokechu22
5f7c852d22 DSPSpy: Split main dsp_base logic from interrupt handlers
This is so that interrupt handlers can be manually specified in tests that need them.
2021-08-21 20:10:42 -07:00
Pokechu22
87dc668522 DSPSpy: Fix hang when using the free DSP rom 2021-08-21 20:10:42 -07:00
Tilka
e7a30dd468
Merge pull request #10048 from Pokechu22/dsp-manual
Improvements to DSP manual
2021-08-22 04:06:49 +01:00
Pokechu22
88d2a7260d DSPLLE: Improve various instruction comments
* DSP*Arithmetic: Fix grammar for ANDCF and ANDF
* DSP*Arithmetic: Fix registers used by MOVAX and MOV
* DSP*Branch: Fix documentation for JMPR
* DSP*Branch: Fix HALT encoding ("I think I saw a two")
* DSP*ExtOps: Fix 'LN encoding (The listed encoding was for 'L)
* DSP*ExtOps: Improve documentation for 'LD and 'LDAX
* DSPJitExtOps: Correct typo
* DSP*LoadStore: Remove obsolete comment about pc in SRS (This was fixed in 1419e7e5b2)
* DSP*LoadStore: Fix comments for LRR/SRR
* DSP*Misc: Improve documentation for SBCLR and SBSET
* DSP*Multiplier: Fix MULXAC encoding (The previous encoding was for MULXMVZ)
* DSP*Multiplier: Fix tabs in MULCAC and MULCMVZ (There are some other tabs in comments in the JIT, but these are the only ones that are in instruction comments instead of indicating the corresponding interpreter code.  Those other comments can be corrected in a different PR, as they're not documentation related.)
* DSPJitMultiplier: Fix MULXMVZ typo
2021-08-21 17:07:14 -07:00
Pokechu22
ddc2dd91d2 DSPSpy: Create README.md 2021-08-21 17:07:14 -07:00
Pokechu22
1ad8dd7634 DSPSpy: Remove build.sh and sbuild.sh
This also removes the emu folder from the Makefile, and the Config.h file.  I'm not entirely sure what build.sh was for, but my best guess is that it was some kind of tool to run emulated DSP code at the same time as the actual DSP code and compare the results.  I don't know if it ever worked, but it certainly doesn't work now.
2021-08-21 17:07:14 -07:00
Pokechu22
3eaf06d2e0 DSPSpy: Create .gitignore 2021-08-21 17:07:14 -07:00
Pokechu22
4fa9517ba3 docs/DSP: Update version and history
The GFDL requires the history section to be updated.
2021-08-21 17:07:14 -07:00
Pokechu22
9ef388f1c3 docs/DSP: NEG can set overflow and carry 2021-08-21 17:07:14 -07:00
Pokechu22
602163b623 docs/DSP: Fix typo with MULCMVZ and MULCMV 2021-08-21 17:07:14 -07:00
Pokechu22
c51c339424 docs/DSP: Document initialization process 2021-08-21 17:07:14 -07:00
Pokechu22
5bf59f3ce4 docs/DSP: A failed RETcc only inceases PC by 1, not 2
This is because RETcc is a single-word instruction.
2021-08-21 17:07:14 -07:00