629 Commits

Author SHA1 Message Date
dingusdev
240ec95a74 bench1: Set power_off_reason. 2024-12-17 18:46:20 -07:00
joevt
e4d9cb95b4 ppcexec: Make ppc_exec template functions. 2024-12-14 06:32:07 -07:00
joevt
98c7e224fe ppcmacros: Make rot_sh unsigned. 2024-12-14 06:31:59 -07:00
joevt
ac0faf78fd poweropcodes: Fix more compiler warnings. 2024-12-14 06:31:51 -07:00
joevt
d48eefceb0 poweropcodes: Remove undefined behavior.
Shift 32 is undefined.
-2^31 - 1 is undefined.
2024-12-12 08:03:47 -07:00
joevt
78f62c8db8 ppcfpopcodes: Use macros for ppcstate.
Helps with abstraction.
2024-12-10 18:18:32 -07:00
joevt
a64b000459 ppcfpopcodes: Remove extra space. 2024-12-10 18:18:23 -07:00
joevt
1da7cb1c2f ppcmacros: Remove semicolon from one line macros. 2024-12-10 18:18:12 -07:00
joevt
49b8c4c39f ppcfpopcodes: Fix Revert Tweak.
Fixes lfsu, lfsux, lfdu, lfdux so they correctly update rA as before.
2024-12-11 00:19:06 +01:00
dingusdev
47969d9d50 Reverting tweak
Restoring Virtus Player back to 'normal'
2024-12-07 20:49:00 -07:00
Mihai Parparita
ab5f7071ce Suppress Clang warnings about volatile being deprecated 2024-12-07 15:30:24 -08:00
joevt
cea889bde5 ppcopcodes: Cleanup lzu lzux lhau lhaux. 2024-12-07 06:34:00 -07:00
dingusdev
d22f926a8a Tweak s*u(x) and l*u(x) instructions for 601
These are what the instructions are supposed to do according the 601 manual.
2024-12-06 07:07:36 -07:00
joevt
b512702fbb ppcopcodes: Fix indent in ppc_mtsr. 2024-12-03 06:52:20 -07:00
joevt
47fca9f4ff ppcexec: Fix absolute address comment. 2024-12-03 06:52:09 -07:00
joevt
ee8c912397 poweropcodes: Fix clcs for MPC601.
These output values will pass the current set of risu tests which tests all 32 input values multiple times.
2024-12-03 06:51:56 -07:00
joevt
3fd422008e ppcfpopcodes: Use enums instead of literals. 2024-12-03 06:51:15 -07:00
joevt
bce4c98475 ppcfpopcodes: Fix fdiv for MPC601. 2024-12-03 06:50:57 -07:00
joevt
b45b0a8df4 ppcopcodes: Fix divw for MPC601. 2024-12-03 06:50:17 -07:00
joevt
b8af8d387c ppcopcodes: Fix divu for MPC601. 2024-12-03 06:50:08 -07:00
joevt
84075c5988 ppcopcodes: Fix lswx for MPC601. 2024-12-03 06:49:53 -07:00
dingusdev
35919802f3 Tweak fsel
Inspired by a similar fix toxieainc committed for Supermodel
2024-12-03 06:49:08 -07:00
joevt
80b763ecc3 ppcexec: Fix OP59d.
Some of these accept a 4th register "C" so they exist in the opcode table 32 times.
Some of these don't accept a 4th register "C" so they exist in the opcode table once.
2024-12-03 12:12:56 +01:00
dingusdev
f355fb0dfe
Merge pull request #127 from mihaip/upstream-opcode-dispatcher
ppc: Use a unified opcode lookup table
2024-11-30 12:51:08 -07:00
Mihai Parparita
b759f25d87 ppc: Use a unified opcode lookup table
Instead of a primary opcode lookup table with 64 entries and a few
smaller tables with 4-2048 entries, use a single 64 * 2048 (128K)
entry table to dispatch opcodes.

Helps with performance, since we avoid the function call overhead for
some frequently-used instructions (e.g. branch, integer, floating point).
Saves ~2 seconds from the time to Welcome to Macintosh (same measurement
methodology as #125)

Secondarily also makes opcode registration/decoding a bit more uniform,
and scannable, since it's now all in initialize_ppc_opcode_table.
2024-11-30 20:37:26 +01:00
Maxim Poliakovski
aa17bf06de ppcmmu: implement mem_write_dbg method. 2024-11-30 11:55:16 +01:00
Mihai Parparita
bf92b04d6c debugger: Use a named constant when we don't have a current instruction 2024-11-29 18:33:22 +01:00
Mihai Parparita
564c43c907 Remove ppc_cur_instruction global variable
Replace it wth an explicit opcode parameter that is passed around. That
is both slightly easier to reason about (to trace where it comes from)
and slightly faster, since it can be read from a register.

On my machine takes booting to "Welcome to Macintosh" being output in
a verbose boot of Mac OS X 10.2.8 from 31.8s to 30.6s (average of 5
runs, measured using deterministic mode and looking at when execution
reaches PC 0x90004a88).
2024-11-28 23:41:38 +01:00
Mihai Parparita
2d90aff408 ppc: Remove unncesessary function declarations
ppc_opcode16 and other functions are only needed in the implementation in
ppcexec.cpp, they don't need to be in the header.

fp_return_double and fp_return_uint64 have no uses (as of 2141a72b873763995b3428353dc7fd9d5bb47abb)
can can thus be removed altogether.

Similarly ppc_fpu_off has no uses (as of bb3f4e596e3f18f9414daa94e3639d2c192e93ec)
and can be removed.
2024-11-28 22:12:16 +01:00
joevt
820da037da ppcmacros: Add missing space. 2024-11-28 07:25:23 -07:00
joevt
00f38133e9 ppcfpopcodes: fnabs fix.
fnabs sets the sign bit regardless of nan status.
2024-11-28 07:25:14 -07:00
joevt
e231dc4dec ppcfpopcodes: fabs fix.
fabs clears the sign bit regardless of nan status.
2024-11-28 07:25:06 -07:00
joevt
549cb2284c Revert "Tweaking conditional branch instructions"
This reverts commit 0835e6f9f474899bce7dd0c901b1119cc51cbfe4.
2024-11-27 08:20:05 -07:00
joevt
d41287c320 ppcfpopcodes: fneg fix.
fneg inverts the sign bit regardless of nan status.
2024-11-27 08:06:31 -07:00
joevt
b38b1731a0 ppcopcodes: Don't change MQ if not MPC601.
MQ should not be writable if not doing MPC601.
Fix is_601 and include_601.
This fixes risu tests.
2024-11-27 07:59:19 -07:00
Maxim Poliakovski
04280ecda4 Revert "Fix LR update in bc instructions"
This reverts commit 5a0a7b12e4c539ece5c6b745946bb140684554e7.
2024-11-25 21:56:32 +01:00
dingusdev
5a0a7b12e4 Fix LR update in bc instructions
Only executes when the branch path is taken.
2024-11-20 20:53:59 -07:00
dingusdev
0835e6f9f4 Tweaking conditional branch instructions 2024-11-20 18:23:03 -07:00
Mihai Parparita
f65f9b9845 Add a deterministic execution mode
Adds support for a --deterministic command-line option that makes
repeated runs the same:
- Keyboard and mouse input is ignored
- The sound server does a periodic pull from the DMA channel (so that
  it gets drained), but only does so via a periodic timer (instead of
  being driven by a cubeb callback, which could arrive at different
  times)
- Disk image writes are disabled (reads of a modified area still
  work via an in-memory copy)
- NVRAM writes are disabled
- The current time that ViaCuda initializes the guest OS is always the
  same.

This makes execution exactly the same each time, which should
make debugging of more subtle issues easier.

To validate that the deterministic mode is working, I've added a
periodic log of the current "time" (measured in cycle count), PC
and opcode. When comparing two runs with --log-no-uptime, the generated
log files are identical.
2024-11-09 22:48:06 -08:00
dingusdev
6ca5b738d5 More FPU refactoring
Now down to 520 tests
2024-11-01 21:28:13 -07:00
dingusdev
f660efcd54 Continued FPU fixes 2024-10-30 07:46:44 -07:00
dingusdev
5f826d6a9d More floating point fixes
Down to 752 failing tests
2024-10-27 12:51:16 -07:00
dingusdev
873f8632e4 More floating point fixes
Confirmed to partially fix Mac OS X installation screen errors
2024-10-26 16:16:52 -07:00
dingusdev
af7c22e7b3 Compile fixes, pt. 2 2024-10-17 19:50:15 -07:00
dingusdev
28ec650e4f Compile fixes 2024-10-17 19:41:58 -07:00
dingusdev
329bcc68b1 Floating-point fix-ups
Largely to fix setting flags, but partially to fix the incorrect nan emulation
2024-10-17 08:00:27 -07:00
dingusdev
02c8c8cde0 Fix bench + test compilation (again) 2024-09-30 20:35:33 -07:00
dingusdev
8c42685e26 Slight compile fix 2024-09-24 21:17:48 -07:00
dingusdev
01ceaef8d7 Slightly delaying a race condition 2024-09-24 21:10:10 -07:00
joevt
55d7c8f09d bench1 fix 2 2024-09-24 21:07:51 -07:00