Commit graph

66 commits

Author SHA1 Message Date
Henrik Rydgård
6945deec01 Replace a LOT of sprintf with snprintf, and a few strcpy with truncate_cpy 2023-04-28 21:04:05 +02:00
Henrik Rydgård
aba026f7e9 Add back our older VFPU approximations, as fallbacks if files are missing.
PR #16984 added more accurate versions of these functions, but they require
large lookup tables stored in assets/.

If these files are missing, PPSSPP would simply crash, which isn't good.

We should probably try to warn the user somehow that these files are
missing, though...
2023-04-03 11:33:41 +02:00
Henrik Rydgård
d996fb74d4 MSVC: Set language standard to c++17.
Noticed that we were getting some new warnings after merging the
constexpr stuff.
2023-04-02 17:55:15 +02:00
fp64
38fc21a2c0 Implement load-on-demand of vfpu tables 2023-03-12 08:21:15 -04:00
fp64
d3be0ee654 Fix tabs vs spaces, tweak comments, error on BE 2023-03-12 08:21:15 -04:00
fp64
67bb17eba3 Add more vfpu_*, move tables to assets 2023-03-12 08:21:15 -04:00
fp64
ee98603fe7 Fix the sign of cos(2*n+1)
Also fix the license text.
2023-03-12 08:21:14 -04:00
fp64
3661bb27ce Implement sin/cos as per #16946 2023-03-12 08:21:13 -04:00
Henrik Rydgård
9e736ca50c Workaround for sin/cos issue in GTA on Mac (and maybe others) 2023-02-07 17:43:12 +01:00
Unknown W. Brackets
a7b7bf7826 Global: Set many read-only params as const.
This makes what they do and which args to use clearer, if nothing else.
2022-12-10 21:13:36 -08:00
Unknown W. Brackets
3f997518f3 irjit: Handle vrot overlap more correctly.
Sine ignores overlap, cosine does not.
2022-10-29 22:25:25 -07:00
Unknown W. Brackets
3df6cb704f Global: Fix some type conversion warnings.
Hidden by some warning disables.
2022-01-30 16:09:33 -08:00
Unknown W. Brackets
a84df2536a Core: Fix vrot cos(2) typo. 2021-04-25 19:26:16 -07:00
Unknown W. Brackets
07cb37c2c1 Compat: Remove single/double sincos path.
New implementation should work for both cases.
2021-04-25 07:09:50 -07:00
Unknown W. Brackets
ad876f06f3 Core: Special case 1/-1 for cosine.
It still gets these off from zero, so let's just special case.
2021-04-24 16:29:20 -07:00
Unknown W. Brackets
8f41c78ed7 Core: Strip off lower bits of sin/cos results. 2021-04-24 16:29:20 -07:00
Unknown W. Brackets
ad9ad0f70b Core: Apply custom narrowing before VFPU sin/cos.
This makes the results much more accurate to the PSP's results.
Could narrow a bit further swapping sin/cos/neg, which might be what the
hardware does given vrot.
2021-04-24 16:29:20 -07:00
Unknown W. Brackets
e9076c90bb Core: Cleanup VFPU float bit handling.
Just to use a common union.
2021-04-24 15:49:22 -07:00
Unknown W. Brackets
f32f89dd90 Global: Remove some unused variables. 2021-02-15 11:59:45 -08:00
Henrik Rydgård
9e4c7c84ac Only use double precision sincos in Hitman Reborn Battle Arena 2. See #12900 2020-11-23 23:51:07 +01:00
Henrik Rydgård
c5e0b799d9 Remove category from _assert_msg_ functions. We don't filter these by category anyway.
Fixes the inconsistency where we _assert_ didn't take a category but
_assert_msg_ did.
2020-07-19 20:33:25 +02:00
Henrik Rydgård
f9ede96344 Address feedback 2019-08-06 16:39:28 +02:00
Henrik Rydgård
8642134419 VFPU-Int: Add a few fast-paths to ReadMatrix/WriteMatrix. Should gain back part of the speed lost in #12217
(which fixed #5399).
2019-08-06 16:29:58 +02:00
Unknown W. Brackets
c1c869df27 interp: Implement software inverse square root. 2019-08-04 21:24:13 -07:00
Unknown W. Brackets
6028b79895 interp: Oops, fix vdot bug with subnormals. 2019-08-04 21:23:19 -07:00
Unknown W. Brackets
13278dc1f4 interp: Implement software sqrt to match PSP.
This matches the PSP's square root better.

Disabled by default using a compile-time flag.
2019-08-04 21:23:04 -07:00
Unknown W. Brackets
7b84be1479 interp: Fix adding infinity in software dot. 2019-08-04 21:17:34 -07:00
Unknown W. Brackets
c61a24cef0 interp: Handle rounding in software dot. 2019-08-04 21:17:27 -07:00
Unknown W. Brackets
d5e572b82e interp: Correct INF * 0 during dot. 2019-08-04 21:17:21 -07:00
Unknown W. Brackets
2ba35c6391 interp: Use an integer multiply for dots. 2019-08-04 21:17:09 -07:00
Unknown W. Brackets
08a894abde interp: Handle NaN better in vfpu_dot. 2019-08-04 21:17:00 -07:00
Unknown W. Brackets
4bff980d34 interp: Use software dot for better accuracy.
This gets some vdot/similar tests to give more accurate results compared
to hardware.  Also added flushing of zero and NaNs.

Currently disabled, only enabled with a compile-time flag.
2019-08-04 21:14:23 -07:00
Unknown W. Brackets
c7e83cd4fa interp: Correct vfim for -inf and similar.
Was dropping the sign bit before for inf and nan.
2019-03-31 13:41:48 -07:00
Unknown W. Brackets
af3ed69144 interp: Mask moves to vfpu ctrl.
These bits of the registers can't be written.
2019-03-31 10:37:07 -07:00
Unknown W. Brackets
b86a6af364 interp: Properly apply mask on single lane ops.
When using something like vadd.s, we should still be applying the mask.
Mainly should only matter if masks are set in a conditional, or if games
nop out instructions.
2019-03-31 10:13:28 -07:00
Unknown W. Brackets
0be3213151 interp: Correct vscl prefix handling. 2019-03-31 10:13:28 -07:00
Unknown W. Brackets
fef8e71b8f interp: Correct behavior for matrixes with size=1.
Games don't (shouldn't?) actually use 1x1 matrices, but they seem to have
predictable behavior in matrix ops.
2019-03-31 08:21:29 -07:00
Unknown W. Brackets
22940f0393 Debugger: Avoid asserts in disassembly. 2018-06-08 06:59:18 -07:00
Henrik Rydgard
e1e335885c A better alternative to #8564 2016-12-01 18:23:58 +01:00
Henrik Rydgard
3cae60b320 Revert potentially dangerous optimization that may have caused #8754, though not sure how. 2016-05-18 21:22:08 +02:00
Henrik Rydgard
2cbfb192c4 IR: Lots more VFPU support, some with SIMD 2016-05-12 12:17:25 +02:00
Bovine
2ed4c1bd6b Fix matrix disassembly notation
Changed disassembler output to match gas input for operations on
transposed matrices where row != col.
2015-01-03 02:04:08 -07:00
Henrik Rydgard
29dcc0a303 Minor cleanups, warning fixes 2014-12-06 12:25:28 +01:00
Henrik Rydgard
8f016d3e48 Merge some matrix utils and stuff from the NEON branch 2014-11-29 11:37:45 +01:00
Aapo Rantalainen
ed6b8e34ab Fix missing includes (stdio.h) 2014-01-01 22:31:03 +02:00
Henrik Rydgård
ce378b231f Delete CPU.cpp/h , cleanup 2013-12-30 00:11:29 +01:00
Henrik Rydgard
2d8429ac48 Assorted cleanup in the MIPS emulation 2013-12-10 13:15:16 +01:00
Unknown W. Brackets
ec05146ffd Improve vfpu disasm for a few instructions. 2013-11-29 10:07:15 -08:00
Henrik Rydgard
55500d4bb6 Reorder VFPU registers in memory so that we can flush and reload them in bulk more often.
Doesn't actually do that yet, that's for the NEON branch.
2013-11-28 13:27:51 +01:00
Unknown W. Brackets
e3834d5833 Avoid some unlikely uninitialized values. 2013-10-26 18:31:14 -07:00