Commit Graph

462 Commits

Author SHA1 Message Date
TellowKrinkle 07e98c7790 CMake: Use imported target for fmt in tests
This properly adds the header include paths when using system fmt
2023-01-29 14:37:54 -06:00
Admiral H. Curtiss 61ba516570
PowerPC: Move a few functions to PowerPCState. 2023-01-27 15:22:44 +01:00
Lioncash e5b91f00b0 Common: Replace StringBeginsWith/StringEndsWith with std equivalents
Obsoletes these functions in favor of the standard member functions
added in C++20.
2023-01-24 14:58:20 -05:00
Pokechu22 597f8f1b87 Externals: Convert gtest to a submodule and update to v1.12.1 2023-01-20 11:43:34 -08:00
Pokechu22 92b6446da1 UnitTests: Add custom main that calls RegisterMsgAlertHandler
This prevents a failed assertion from hanging on the MSVC buildbots.
2023-01-13 15:38:00 -08:00
JosJuice 454537d53e Replace BitUtils with C++20: RotateLeft/RotateRight
Now that we've flipped the C++20 switch, let's start making use of
the nice new <bit> header.

I'm planning on handling this move away from BitUtils.h incrementally
in a series of PRs. There may be a few functions remaining in
BitUtils.h by the end that C++20 doesn't have any equivalents for.
2022-12-11 08:59:18 +01:00
Admiral H. Curtiss daa70533cd
CoreTiming: Store Globals in CoreTimingManager. 2022-11-27 03:47:12 +01:00
Admiral H. Curtiss c9558ecb4c
CoreTiming: Refactor to class. 2022-11-27 03:47:12 +01:00
Admiral H. Curtiss 86f17511fc
CoreTiming: Move the 'Globals' instance into Core::System. 2022-11-26 04:22:32 +01:00
Admiral H. Curtiss 0a6fdb9c13
HW: Pass System to MMIO handlers. 2022-11-23 05:52:21 +01:00
Mai a47ed2124f
Merge pull request #11253 from AdmiralCurtiss/core-timing-events-pass-system
CoreTiming: Pass Core::System to Events.
2022-11-23 04:46:11 +00:00
Pokechu22 0bcd3c79bb VertexLoader: Eliminate use of DataReader
DataReader is generally jank - it has a start and end pointer, but the end pointer is generally not used, and all of the vertex loaders mostly bypassed it anyways.

Wrapper code (the vertex loaer test, as well as Fifo.cpp and OpcodeDecoding.cpp) still uses it, as does the software vertex loader (which is not a subclass of VertexLoader). These can probably be eliminated later.
2022-11-22 17:17:11 -08:00
Admiral H. Curtiss a36a5c1308
CoreTiming: Pass Core::System to Events. 2022-11-06 17:54:58 +01:00
Pokechu22 53ee1b50fe VertexLoaderTest: Add NormalAll
This currently fails for direct with NormalIndex3 enabled (see https://bugs.dolphin-emu.org/issues/12952). The goal of this test is to be able to confidently say that that bug has been fixed.
2022-09-18 23:33:23 -07:00
Pokechu22 729498ab41 VertexLoaderTest: Add DirectAllComponents
We have one that does a similar thing, but only to measure speed and uses indices. This one verifies accuracy (and uses the largest possible input size by using direct components).
2022-09-18 23:33:23 -07:00
Admiral H. Curtiss 8b7e6f1863
Merge pull request #10933 from shuffle2/vs
msbuild: fix overbuilding of externals and lessen rebuild likelyhood
2022-08-22 15:19:13 +02:00
InvoxiPlayGames f9e39cf200 Add Discord presence ioctlv to /dev/dolphin 2022-08-06 07:32:29 +01:00
Shawn Hoffman c5da2877cc msbuild: refactor to reduce rebuild events
* moves dolphin-specific settings out of Base.props
* creates exports.props for externals, allowing to easily import
  individual Externals
* corrects some cruft that accumulated and probably contributed
  to msbuild overbuilding
2022-08-02 22:24:22 -07:00
Tilka fb45ed3981
Merge pull request #10883 from Pokechu22/pi-fifo-reset-gp-fifo
ProcessorInterface: Reset both GPFifo and Fifo on PI_FIFO_RESET
2022-07-31 17:06:37 +02:00
Shawn Hoffman f8b9034a28 Crypto/SHA1: add unittests 2022-07-27 01:07:48 -07:00
Pokechu22 7a03b1fe16 UnitTests: Fix warnings from HermesText
Most of these correspond to changes made in devkitPro/libogc@b1b8ecab3a.

The numeric vlaues of ACC0 and ACC1 in Dolphin are different (see b06d38389b, though I'm not sure when this difference first appeared). Technically it's not even necessary to list the registers at the start like this anymore, but old programs do it, so it seems useful to have a test that covers it.

The binary itself does not need to be changed; the warnings were simply stating that "although you wrote $ACL0, the generated binary instead is using $ACC0" or similar; by changing the code to use $ACC0 directly the warnings are resolved.
2022-07-26 11:52:31 -07:00
Shawn Hoffman 76b4318b88 CPUDetect: improve win/arm64 support
read brand_string on macos/arm64
remove unused flags
report family/model info instead of vendor name
2022-07-25 21:21:11 -07:00
Pokechu22 1c833ddc3c Create constant for GPFifo physical address 2022-07-22 22:22:33 -07:00
Merry 4d99506b4c UnitTests/MovI2R: Test all logical immediates 2022-07-10 22:17:09 +01:00
Pokechu22 dec48ed7de UnitTests: Remove unused include from DSPAssemblyTest 2022-06-14 13:07:14 -07:00
Pokechu22 5ea3efaedf UnitTests: Fix license for HermesBinary.cpp
This is an assembled version of HermesText.cpp, so the same license applies to it.
2022-06-14 12:22:06 -07:00
Pokechu22 75ff89e8c7 UnitTests: Edit wait_for_dsp_mail in HermesText to match HermesBinary
I don't know what happened here, unfortunately.  The version of dsp_mixer.s added to libogc on Nov 14, 2008 in c76d8b851f uses andcf and jlz here, and the version we have matches the one from Feb 5, 2009 in ae5c3a5fb5 exactly (prior to the fixes in my previous commit).  I can't see any reason why wait_for_dsp_mail would be changed like this.

ANDCF and ANDF were previously swapped and JNE/JEQ/JZR/JNZ became JNZ/JZ/JLNZ/JLZ on Apr 3, 2009 in 7c4e654253, corresponding to a change Hermes made on Nov 10, 2008 in 2cea6d99ad. But these predate the test being added.

The only other information I can find is that ASNDLIB 1.0 released on November 11, 2008, at https://web.archive.org/web/20120326145022/http://www.entuwii.net/foro/viewtopic.php?f=6&t=87 (but there aren't any surviving links from there).
2022-06-14 12:22:06 -07:00
Pokechu22 36769017c0 UnitTests: Update DSP test text for old renames
This change makes assembling DSPTestText match DSPTestBinary, though HermesText doesn't yet match HermesBinary.

The test data was originally added on April 18, 2009 in e7e4ef4481.  Then, set16 and set40 were swapped on April 22, 2009 89178f411c, which updated the DSPSpy version of dsp_code, but not the version in DSPTool used for testing.  So, when the test was made, the assembled data matched the text, but a few days after it no longer did.

Similarly, on Jul 7, 2009 in 1654c582ab the conditional instructions were adjusted, and 0x1706 was changed from JRL to JRNC and 0x0297 was changed from JGE to JC.

For what it's worth, devkitPro made the same changes on May 31, 2010 in 8a65c85c9b and updated their version of the asnd ucode (which is this ucode) on June 11, 2011 in b1b8ecab3a (though this update also includes other feature changes). Note that at the time, they didn't reassemble the ucode unless they made changes to it; the assembled was stored in the repo until bfb705fe16~...d20f9bdcfb43260c6c759f4fb98d724931443f93.

This fixes the following failures with Hermes:

!! 0015 : 8e00 vs 8f00 - set16         vs  set40
!! 016f : 8e00 vs 8f00 - set16         vs  set40

and with Hermes:

!! 0014 : 8e00 vs 8f00 - set16         vs  set40
!! 0063 : 8e00 vs 8f00 - set16         vs  set40
!! 019b : 1706 vs 1701 - jrnc        $AR0  vs  jrl         $AR0
!! 01bf : 0297 vs 0290 - jc          0x01dc  vs  jge         0x01dc
!! 01d2 : 0297 vs 0290 - jc          0x01dc  vs  jge         0x01dc

Hermes has the remaining failures:

!! 027b : 03c0 vs 03a0 - andcf       $AC1.M, #0x8000  vs  andf        $AC1.M, #0x8000
!! 027d : 029d vs 0294 - jlz         0x027a  vs  jnz         0x027a
2022-06-14 12:22:06 -07:00
Pokechu22 d52528a6f0 UnitTests: Add tests for assembling DSP code to expected binary
We already have the data for this, so this seems like a useful thing to do.  However, neither of the new tests currently pass...
2022-06-14 12:22:06 -07:00
Pokechu22 6a2ec825a2 UnitTests: Fail DSPAssemblyTest if the assembled code doesn't match the expected result
This reveals that both HermesText and HermesBinary fail.  HermesBinary would have failed on master, too, if this had been implemented.
2022-06-14 12:22:06 -07:00
Pokechu22 d8803a1298 UnitTests: Use fmt::print in DSPAssemblyTest 2022-06-14 12:22:05 -07:00
Pokechu22 8fac249581 UnitTests: Use fmt::print in PageFaultTest 2022-06-14 12:22:05 -07:00
Pokechu22 dd66dac5c1 UnitTests: Fix typo in DSPAssemblyTest 2022-06-14 12:22:05 -07:00
Pokechu22 3cb0976367 UnitTests: Use hermes.s as part of an actual test
Before, the file just existed as the source code for HermesBinary.cpp, but we can test that things assemble correctly too (compare DSPTestBinary.cpp and DSPTestText.cpp).

A bit of jank is needed due to MSVC limitations (see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2026?view=msvc-170).
2022-06-14 12:22:05 -07:00
Dentomologist 2999cca41b UnitTests: Fix -Wrange-loop-construct warnings
Don't use reference variable bound to a temporary value
2022-06-03 22:28:17 -07:00
Pokechu22 0fc1fb023f
Merge pull request #10678 from Dentomologist/skip_pagefault_test_if_no_exception_handler
UnitTests: Skip PageFaultTest if exception handlers aren't supported
2022-06-02 16:21:21 -07:00
Dentomologist 6ffd938f98 UnitTests: Skip PageFaultTest if exception handlers are not supported
Page faults should only occur on architectures that support exception
handlers, so skip the test on other architectures to avoid spurious test
failures.
2022-05-19 12:26:41 -07:00
Pokechu22 46bcdc4372 Rename CP and XF normal component count enums and update their descriptions 2022-05-18 14:43:14 -07:00
Shawn Hoffman 64cd4cc86f msbuild: use default Project attrs
maybe it makes the xml less scary :D
2022-04-27 15:26:43 -07:00
Shawn Hoffman cad1f2735c msvc: disable optimizations for x64EmitterTest.cpp
40s -> 5s speedup
2022-04-27 15:06:04 -07:00
Shawn Hoffman 09432ef098 windows: move ffmpeg bins to submodule
udpate ffmpeg to b1cbeabf5e4b3234e895a58bafa371bfb792baf0
enable ffmpeg on arm64
2022-03-29 17:27:46 -07:00
JosJuice 7b8e846d0a
Merge pull request #10367 from Pokechu22/fmt-8.1.1
Update to fmt 8.1.1
2022-01-20 21:14:41 +01:00
Pokechu22 6e5f4125e3 Use Common::ToLower and Common::ToUpper 2022-01-16 17:00:12 -08:00
Pokechu22 ac46b91673 Make all fmt::formatter constructors constexpr 2022-01-13 11:11:08 -08:00
Pokechu22 161c627466 Treewide: Remove unused inclusions of <cinttypes>
Most of these became unneeded when fmt was introduced.
2022-01-09 12:43:11 -08:00
Admiral H. Curtiss cae4b545bd
Config: Port CPU overclock settings to new config system. 2021-12-25 21:52:50 +01:00
Pokechu22 95e0f833f9 Fifo analyzer: Display equations for color/alpha combiners 2021-12-18 15:21:48 -08:00
Pokechu22 1914087998 Create and use CPArray enum class 2021-12-18 12:51:56 -08:00
Dylan Smit 9de7ef6d8d Fix improper naming
I'm so sorry
2021-11-24 17:04:30 +01:00
JMC47 e5a4a86672
Merge pull request #10055 from JosJuice/jitarm64-reuse-memory
JitArm64: Codegen space reuse
2021-11-20 17:35:24 -05:00
JosJuice 44beaeaff5 Arm64Emitter: Check end of allocated space when emitting code
JitArm64 port of 5b52b3e.
2021-10-13 21:52:16 +02:00
Pokechu22 78bfd25964 Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
JMC47 a1e806ed76
Merge pull request #9600 from Bonta0/mgba-pr
Full GBA Controllers Integration with mGBA
2021-07-21 02:36:43 -04:00
Shawn Hoffman 1009825cb2 unittests: remove some msvc-specific casts
compiles on contemporary msvc
checked there is still a mul in release codegen
2021-07-17 17:41:41 -07:00
Bonta 2d744da68c Core: Add GBA host interface 2021-07-13 16:42:49 +02:00
Léo Lam 56fdde5d74
Merge pull request #9595 from Dentomologist/fix_vertex_loader_test_warnings
VertexLoaderTest: Fix memset assignment warning
2021-07-06 11:50:23 +02:00
Pierre Bourdon 0cf041de24
licensing: various one-off conversions to SPDX tags 2021-07-05 04:35:56 +02:00
Pierre Bourdon e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
Tilka 901a4fb5f4
Merge pull request #9811 from JosJuice/fprf-denormal-singles
Fix FPRF handling of denormal singles
2021-06-29 03:18:18 +01:00
Tillmann Karras afb9398059 x64Emitter: remove unused x87 instructions 2021-06-28 02:56:37 +01:00
JosJuice d56721ebb9 Interpreter: Fix FPRF handling of denormal singles 2021-06-27 20:34:49 +02:00
Skyler Saleh 655ed37983 Unit Tests: Added W^X Support for PowerPC test 2021-06-19 10:40:51 -07:00
Pokechu22 1500a0119b Eliminate TVtxDesc.GetLegacyHex 2021-06-09 20:50:50 -07:00
Dentomologist 99ed43280d Updater: Escape HTML characters in commit descriptions 2021-06-01 17:22:19 -07:00
Filoppi 3c7c2dfaa1 Implement Cursor Locking and new input focus checks for it 2021-05-27 10:31:12 +03:00
Mai M 6958df5967
Merge pull request #9695 from JosJuice/jitarm64-fres
JitArm64: Implement fres and frsqrte
2021-05-20 10:23:49 -04:00
JosJuice 4b3fda7906 JitArm64: Implement frsqrte 2021-05-15 19:21:15 +02:00
JosJuice 85226e09f0 JitArm64: Implement fres 2021-05-15 19:16:32 +02:00
Mat M d74a1068b8
Merge pull request #9540 from Pokechu22/better-fifo-analyzer-part-2
Fifo analyzer quality of life improvements
2021-05-14 15:51:53 -04:00
JosJuice 25dc059f6f JitArm64: Add FPRF unit test 2021-05-13 11:51:00 +02:00
Pokechu22 0a906f553f Move vertex size and component calculation to VertexLoaderBase 2021-05-07 15:42:17 -07:00
Léo Lam 70d8a78edc
Merge pull request #9683 from JosJuice/ppc-test-values
UnitTests: Put PowerPC test values in a separate file
2021-05-07 14:44:27 +02:00
JosJuice bb39f75093 UnitTests: Put PowerPC test values in a separate file
We use more or less the same values for all PowerPC float unit
tests. Let's put them in one place instead of duplicating them.
2021-05-02 22:12:28 +02:00
JosJuice 1f6bb06f2c UnitTests: Move some unit tests to where they should be
Two unit tests were in the root UnitTests folder
and were not being built when using CMake.
2021-05-02 18:07:02 +02:00
JosJuice 9d6263f306 JitArm64: Add unit tests for single/double conversion 2021-04-25 15:56:58 +02:00
Léo Lam 8d21fa56a1
UnitTests: Use MathUtil::SaturatingCast to avoid UB
[conv.fpint]/1:

> A prvalue of a floating-point type can be converted to a prvalue of
> an integer type. The conversion truncates; that is, the fractional
> part is discarded. The behavior is undefined if the truncated value
> cannot be represented in the destination type.
2021-04-06 23:27:23 +02:00
Léo Lam 48712168b8
MathUtil: Add SaturatingCast to cast floats more safely 2021-04-06 23:27:23 +02:00
JosJuice 27ddf6382b Set console's default language/country/region based on computer settings 2021-03-27 10:05:26 +01:00
Pokechu22 51de3d0fd1 Refactor CP array constants slightly 2021-03-26 17:27:21 -07:00
LC 15ebb1d9e4
Merge pull request #9566 from Sintendo/jit64divwx
Jit64: Optimize divwx
2021-03-22 14:40:02 -04:00
Dentomologist 1cc035eb05 VertexLoaderTest: Fix memset assignment warning
Initialize and assign members of TVtxDesc and VAT structs directly
instead of using memset.

Fixes -Wclass-memaccess warning from gcc on Debian.
2021-03-18 21:10:29 -07:00
Dentomologist f0f206714f Arm64Gen: Convert ARM64Reg to enum class
Most changes are just adding ARM64Reg:: in front of the constants.
2021-03-13 10:10:59 -08:00
Sintendo 5bb8798df6 JitCommon: Signed 32-bit division magic constants
Add a function to calculate the magic constants required to optimize
signed 32-bit division.

Since this optimization is not exclusive to any particular architecture,
JitCommon seemed like a good place to put this.
2021-03-07 18:27:36 +01:00
Pokechu22 f749fcfa9f Convert CPMemory to BitField and enum class
Additionally, VCacheEnhance has been added to UVAT_group1.  According to YAGCD, this field is always 1.

TVtxDesc also now has separate low and high fields whose hex values correspond with the proper registers, instead of having one 33-bit value.  This change was made in a way that should be backwards-compatible.
2021-03-06 19:27:08 -08:00
Pokechu22 f697e17dd1 Create BitFieldArray 2021-03-06 17:34:03 -08:00
Pokechu22 1273c5e395 Add fmt support to BitField 2021-03-06 14:58:32 -08:00
Pokechu22 cf95deaf6d Allow specifying StorageType for BitField
This is useful for BitFields that are bools.
2021-03-06 14:57:44 -08:00
Pokechu22 6653bd7199 Create EnumFormatter 2021-03-06 14:57:42 -08:00
JosJuice eff66c2adc Arm64Emitter: Expand the MOVI2R unit test a little
This tests for a bug with ADRP which was present in an
earlier version of this pull request.

Also adding the MOVI2R unit test to the VS build.
2021-02-13 21:04:16 +01:00
MerryMage 1ab7657120 MovI2R: Do not exhaustively test 2021-01-31 13:17:31 +00:00
MerryMage fe9207bb56 UnitTests: Add MOVI2R test 2021-01-31 13:17:19 +00:00
Shawn Hoffman 500a694ca8 msbuild: bundle all dolphin "core" code into single library 2021-01-27 14:29:49 -08:00
Léo Lam 305faa73ec
Merge pull request #9436 from shuffle2/asan
msvc: enable asan compat
2021-01-27 13:24:26 +01:00
Dentomologist 83f912b58a UnitTests: Add setup error checking
Check return value of calls to File::CreateTempDir() from CoreTiming,
FileSystem, and MMIO test classes to verify the test user directory
exists, and fail the tests otherwise.
2021-01-22 11:49:59 -08:00
Shawn Hoffman 49b9deeb03 msvc: add asan support (disabled by default) 2021-01-10 15:11:18 -08:00
Léo Lam 2e63cc8313
Merge pull request #9307 from Dentomologist/add-deleted-file-missing-warning-flag
Add File::Delete and File::DeleteDir warning flags
2020-12-11 02:06:28 +01:00
Dentomologist 760e7e664a Add File::Delete and File::DeleteDir tests 2020-12-10 09:48:30 -08:00
Léo Lam 585899dba3
Turn format string issues into compile-time errors
If the compiler can detect an issue with a format string at compile
time, then we should take advantage of that and turn the issue into a
hard compile-time error as such problems almost always lead to UB.

This helps with catching logging or assertion messages that have been
converted over to fmt but are still using the old, non-fmt variants
of the logging macros.

This commit also fixes all incorrect usages that I could find.
2020-12-04 18:06:02 +01:00
Admiral H. Curtiss 5b52b3e9cb x64Emitter: Check end of allocated space when emitting code. 2020-08-24 19:31:32 +02:00
Shawn Hoffman 2f47f486af msbuild: re-enable standalone vcxproj processing 2020-08-22 16:17:50 -07:00