`fres` is reimplemented in an unoptimized way but it handles all edge cases
The specific magic numbers were binary searched on hardware
Someday NI maybe should be an option with the normal fres tests and not only ps_res
Adds a new file for common float tests -- This will likely be used more in the future as well
Modifies two other tests which use thing now use functions in the CommonFloat file (the location of frsqrte_expected very well may change)
Adds software implementation of mantissa truncation and rounding given the expected rounding mode
Both of these are for tests for float move instructions
These instructions include ps_merge, ps_mr, ps_neg, ps_abs, ps_nabs, and ps_rsqrte is included to check for a similar quirk
I wrote these two tests because I wanted to test if the behavior I
implemented in https://github.com/dolphin-emu/dolphin/pull/10959 should
affect the results of arithmetic operations in addition to frsp. It
turned out that Dolphin was already correctly emulating these two tests
(I frankly don't understand how in the float case), but I figured I
would submit the tests regardless. If nothing else, it's good for
documenting what the real hardware is doing.
This allows assigning unions from CGXDefault, but still prevents the bad behavior of copying all bits when assigning one individual BitField to another.
This reverts commit 9b7be93420. Note that this reversion means code no longer compiles properly. (Also note that BitField.h is still modified from the version used in Dolphin, to remove references to Inline.h.)
Phire suggested this. Z pokes don't work properly for some reason, but we can write arbitrary values to the Z buffer by writing to the color buffer, then performing an EFB copy, then using that EFB copy as a texture with the Z-texture functionality enabled.
Currently these are direct wrappers, but we may need to replace them with something more complicated in the future (and this also avoids directly calling GX functions in tests, since not all GX functions are state-free (though these are)).
Note that there are some small differences:
- TextureFormat, TLUTFormat, and EFBCopyFormat are normally in a different header, but I've put them here instead
- I've added a function to set the copy format to UPE_Copy
- I've removed the use of Common/Inline.h
- I've removed non-implemented functions and the actual BP memory struct
- I've made the enum of various registers have a base type of u32 (which allows bitshifting with it without warnings)
Note that this change does not compile on its own, as hwtests requires the default copy-assignment operator for unions to be copied properly. (The file has also been slightly modified to remove references to Common/Inline.h.)
WriteMtxPS4x2 has been removed since register is no longer a keyword. It wasn't used in any case. I've also enabled additional warnings (though I haven't fixed any of them).
privDoTest (and thus DO_TEST) now is marked as using printf formatting, so gcc will complain if the format string is wrong. I also added a fake call to OSReport which will show up in Dolphin's console.