Commit graph

599 commits

Author SHA1 Message Date
Tyler Stachecki
274d61e9ca Same as the last commit, but with the RSP. 2015-01-05 21:46:31 -05:00
Tyler Stachecki
c8ba97efc3 Mark LDI (interlocks) as unlikely.
MIPS compilers of the time optimized this out very aggressively as
they waste cycles and there's generally other instructions you can
toss in the load delay slot, so flag the interlock as unlikely.
2015-01-05 21:27:49 -05:00
Tyler Stachecki
8dd7195dfc Prevent a if statement over ternary expressions. 2015-01-05 20:54:50 -05:00
Tyler Stachecki
2301115c7a Make interrupt exception checks more efficient. 2015-01-05 19:53:36 -05:00
Tyler Stachecki
c7d4fe77ad Fix a last-minute bug in TLB exceptions. 2015-01-05 12:29:00 -05:00
Tyler Stachecki
9008e999af Add support for TLB modification exceptions. 2015-01-05 12:14:34 -05:00
Tyler Stachecki
e342a0ba2a Implement cache operations, fix cache op bug.
If we're doing a cache operation in the DC stage, don't
change the stage of the lines; the cache operations will
do it if needed. Also implement get/set taglo for DC.
2015-01-04 22:40:36 -05:00
Tyler Stachecki
da2fd05415 Respect the TLB entry conherency bits.
If the TLB entry 'C bits' indicate the cache isn't to be
used for that virtual address range... don't use the cache.
2015-01-04 21:33:29 -05:00
Tyler Stachecki
0d7a42c4ce Move cache functionality to the DC stage.
This is how the actual processor does it. In addition to
design correctness, we have the added benefit of being able
to support cache instructions whose virtual address lies
in a mapped part of the address space.
2015-01-04 21:10:12 -05:00
Tyler Stachecki
5240b35d45 More cleanup of the fault/TLB code. 2015-01-04 15:37:47 -05:00
Tyler Stachecki
109c9b0875 Temporarily patch the "render half frame" bug.
Not sure why copy_size should = 4 for a 16-bit frame, so
look into that. But for now, it won't cause any buffer
overruns, so enable it with a warning.
2015-01-04 12:13:57 -05:00
Tyler Stachecki
94efafe31b Fix the JALR RSP bug, similar to last commit. 2015-01-04 12:12:28 -05:00
Tyler Stachecki
17954bf0b8 Fix bugs, implement WatchLo/Hi support. 2015-01-04 11:52:11 -05:00
Tyler Stachecki
179a81775f Remove an old (unused) file. 2015-01-03 15:20:56 -05:00
Tyler Stachecki
79bc303131 Fix RDP RDRAM access range on Linux. 2015-01-03 13:03:54 -05:00
Tyler Stachecki
3725c7325a Squash IC->RF latch data on a fault. 2015-01-03 12:54:17 -05:00
Tyler Stachecki
8f602d576d Cleanup the VR4300 exception logic somewhat. 2015-01-03 12:40:01 -05:00
Tyler Stachecki
9edd00f286 Remove old function definitions. 2015-01-02 23:55:28 -05:00
Tyler Stachecki
84d19566b9 Merge more functions together. 2015-01-02 23:51:20 -05:00
Tyler Stachecki
4a40a4db8a Merge a handful of the vector compares. 2015-01-02 23:03:15 -05:00
Tyler Stachecki
7262516636 Start merging RSP vector functions.
No need to separate all these functions when they contain so
much common code, so start combining things for the sake of
locality and predictor effectiveness (and size). In addition
to these benefits, the CPU backend is usually busy during the
execution of these functions, so suffering a misprediction
isn't as painful (especially seeing as we can potentially
improve the prediction from the indirect branch).
2015-01-02 22:17:41 -05:00
Tyler Stachecki
2de77746e7 Disable register caching for now.
Until we can work around system libraries stomping over the
registers we want to reserve, just disable register caching for
the time being.
2015-01-02 20:59:09 -05:00
Tyler Stachecki
03663a68f6 Add an implementation for VMACU. 2015-01-02 20:52:39 -05:00
Tyler Stachecki
a3b9e13ac4 Fix VMACF accumulation issues and lighting problems. 2015-01-02 19:47:52 -05:00
Tyler Stachecki
54c79ebc73 Hacky fix to patch register caching.
On Windows, acc_lo (%xmm5) was clashing with the x64 calling
convention, which states %xmm5 is a volatile register and is
the caller's responsibility to save. We need the register
preserved across calls, so until we have a better solution to
the problem, pick registers that are not volatile according to
the calling convention.
2015-01-02 15:31:45 -05:00
Tyler Stachecki
b29b33edff Fix a CFC2/VCE error that produced the wrong mask. 2015-01-01 23:12:07 -05:00
Tyler Stachecki
0ce394bfe8 Fix potential undefined behaviour issues. 2015-01-01 21:57:49 -05:00
Tyler Stachecki
7a6ecabcc1 Fix a series of RSP bugs that krom pointed out. 2015-01-01 21:09:08 -05:00
Tyler Stachecki
8bf8898e97 Add support for building on OS X. 2015-01-01 19:45:48 -05:00
Tyler Stachecki
ae72b6bad3 Add a missing line to CMakeLists.txt. 2015-01-01 16:43:52 -05:00
Tyler Stachecki
06d3d54c60 Restore most TLB functionality from backport. 2015-01-01 15:47:20 -05:00
Tyler Stachecki
cca27a7af5 Update README and prepare for GitHub push. 2015-01-01 15:00:01 -05:00
Tyler Stachecki
af18a8195b Don't boot when if the CIC type is not known. 2015-01-01 14:28:38 -05:00
Tyler Stachecki
9b91fef5ac Automatically seed the PIF RAM based on CIC type. 2015-01-01 14:22:43 -05:00
Tyler Stachecki
71bd2f2350 os/windows: Only show the console when asked. 2015-01-01 13:54:26 -05:00
Tyler Stachecki
c3ffd0ac96 Clean up some rough edges in the last commit. 2015-01-01 13:25:02 -05:00
Tyler Stachecki
6a709a4125 Get the Windows build in running condition. 2015-01-01 12:37:26 -05:00
Tyler Stachecki
28db246373 os/unix: Shuffle things around to align with WINAPI.
Conflicts:
	device/device.c
2015-01-01 11:37:33 -05:00
Tyler Stachecki
287e3370c5 Commit some MSVC-specific workarounds. 2014-12-31 16:20:53 -05:00
Tyler Stachecki
30f9dce6b5 Fix VLT clipping bugs.
Thank you, AIO, for pointing this out.
2014-12-31 16:17:49 -05:00
Tyler Stachecki
b07cd4556f os/unix: Don't race during window initialization. 2014-12-31 10:54:05 -05:00
Tyler Stachecki
d5eb2f2296 Cleanup the recently-committed VCH.
We should refer to %xmm5 as acc_lo.
2014-12-31 10:36:09 -05:00
Tyler Stachecki
6b19fd56c9 Fix RSP bug that arises on BREAK. 2014-12-31 10:19:59 -05:00
Tyler Stachecki
878521f54b Add register-caching version of VCH.
Thanks go out to AIO for rounding out this commit with
his optimized SSE2 variant.
2014-12-31 08:51:40 -05:00
Tyler Stachecki
f0c4c90d7a Fix a typo that broke some builds. 2014-12-30 17:51:06 -05:00
Tyler Stachecki
f80d494723 Convert AIO's VABS optimization to AVX. 2014-12-30 17:49:19 -05:00
Tyler Stachecki
4fdf41cb61 Fix a mask typo in the last commit. 2014-12-30 17:36:06 -05:00
Tyler Stachecki
9804d16330 Fix a buggy accumulator clamp algorithm. 2014-12-30 17:26:35 -05:00
Tyler Stachecki
31577f57e6 Enable register-caching on MinGW.
Use a prelude to get around Microsoft's stupid calling convention.
2014-12-30 11:37:08 -05:00
Tyler Stachecki
a4201f4435 Unbreak Windows builds (again). 2014-12-30 10:40:11 -05:00