SarahW
ab124776a0
Rework self modifying code handling.
...
Code blocks now have a varying level of granularity in the page and dirty masks.
Most blocks have 64-byte granularity, but blocks that are repeatedly modified
drop to 1-byte granularity. This reduces the maximum size of the affected block
significantly, but reduces recompilation due to data located too close to code.
If the block is still marked as dirty, then it is recompiled without any
immediate instruction parameters being baked into the recompiled code, instead
being fetched from the RAM array as needed. This severely reduces recompilation
rates on some SMC-heavy games, eg Duke Nukem 3D, System Shock, Screamer etc,
giving a major speedup.
2019-03-16 14:53:26 +00:00
SarahW
063ffb4eab
Update Makefile.mingw-wx-sdl2.
2019-02-14 19:39:47 +00:00
SarahW
01e86135ab
Tweak FDC command timing and add register access waitstates. Fixes floppy in Windows 98 with VA-503.
2019-02-13 22:12:53 +00:00
SarahW
a73081f0bd
Fix ARM and ARM64 build errors.
2019-02-13 21:11:27 +00:00
SarahW
3f2d9ecf87
Optimise out redundant uOPs, where the output register is never read.
2019-02-10 12:32:25 +00:00
SarahW
84622584e2
Move CPU tables to separate file.
2019-02-08 21:34:02 +00:00
SarahW
ce4436054d
Replace cpu_has* flags with single cpu_features variable and cpu_has_feature() getter.
2019-02-08 21:22:53 +00:00
SarahW
03b5a44aca
More CPU sanitisation.
2019-02-08 21:17:56 +00:00
SarahW
2554952658
Remove unused checkio_perm() macro.
2019-02-08 19:36:30 +00:00
SarahW
5b58b202a1
More CPU sanitisation.
2019-02-07 22:10:34 +00:00
SarahW
1b8a1e79af
Move common 386+ functions and variables out of 386.c and 386_dynarec.c and into new 386_common.c.
2019-02-07 22:09:59 +00:00
SarahW
dd68b19f0a
Second CPU sanitising pass.
2019-02-07 21:53:44 +00:00
SarahW
1af0b660b3
First pass at sanitising CPU headers.
2019-02-07 21:30:53 +00:00
SarahW
2735920f58
De-duplicate allocation code in mem_init().
2019-02-07 20:34:06 +00:00
SarahW
3c2dbf063e
Remove unused and superfluous variables from mem.c.
2019-02-07 20:23:14 +00:00
SarahW
5edc23a602
Reduce number of massive static arrays in mem.c.
2019-02-07 20:21:39 +00:00
SarahW
87031d4d09
Remove readmemb386l() and writememb386l().
2019-02-07 20:18:03 +00:00
SarahW
d4d6a26283
Added recompiled versions of ADC and SBC.
2019-02-06 21:07:45 +00:00
SarahW
222071b742
ADC and SBC now use lazy flags.
2019-02-05 21:54:38 +00:00
SarahW
b105445a52
Correct Voodoo hvRetrace register. Fixes intermittent hangs on Voodoo mode setting.
2019-02-04 21:32:25 +00:00
SarahW
d66731f85a
In codegen_ir_compile(), rearrange order of register lookups and order barrier flushing to reduce pointless writes of temporary registers.
2019-02-03 21:35:24 +00:00
SarahW
095cf53265
Added segment limit checking to some instructions.
2019-02-03 17:48:11 +00:00
SarahW
4c523a5fe2
Split x86 and x86-64 ops files into main/FPU/SSE files.
2019-02-02 19:20:42 +00:00
SarahW
9a6376dbf9
Clear codeblock physical addresses when resetting codegen. Fixes out-of-bounds accesses to the pages[] array during reset.
2019-02-02 13:46:06 +00:00
SarahW
2ccf771cf3
Cleaned up exec386_dynarec() a bit.
2019-02-01 20:11:08 +00:00
SarahW
9060f4552f
Remove fake 3-operand instructions in x86-64 backend.
2019-01-28 21:56:57 +00:00
SarahW
e822460f33
Fix missing function prototypes in codegen_backend_x86-64_ops.h.
2019-01-28 21:22:03 +00:00
SarahW
9283ab5fef
Hide fatal()s in codegen_backend_x86-64_uops.c behind a RECOMPILER_DEBUG #define.
2019-01-28 21:21:47 +00:00
SarahW
b018dc1005
Remove fake 3-operand instructions in x86 backend.
2019-01-28 21:08:01 +00:00
SarahW
f0225d2710
Hide fatal()s in codegen_backend_x86_uops.c behind a RECOMPILER_DEBUG #define.
2019-01-28 20:30:08 +00:00
SarahW
ca89a51478
Remove redundant oldcs variable - when processing an exception, oldcs and CS are the same.
2019-01-28 20:00:49 +00:00
SarahW
427aa72a15
Don't set cpu_state.oldpc at the start of every iteration of the recompiler main loop.
2019-01-28 19:25:09 +00:00
SarahW
6e5336ae56
When compiling with CODEBLOCK_STATIC_TOP, update TOP register with immediate moves rather than add/sub.
2019-01-28 17:40:28 +00:00
SarahW
32d4f4c765
Fix incorrect PC size detection on LOOP/LOOPE/LOOPNE/JCXZ/JECXZ. Fixes Heaven 7.
2019-01-27 22:21:06 +00:00
SarahW
889ca7f3f2
Remove test-USE32-and-mask-PC operation from interpreter as well.
2019-01-27 21:22:35 +00:00
SarahW
ee186dbb0d
Remove test-USE32-and-mask-PC operation following code block execution. Instead, ensure that all recompiled instructions mask PC correctly.
2019-01-27 20:54:22 +00:00
SarahW
7b3b6a745d
Remove pointless NULL check against block in recompiler loop.
2019-01-27 20:52:59 +00:00
SarahW
6c65c34bd3
Don't clear trap at the start of the recompiler loop; instead, clear it when actually taking a trap.
2019-01-27 20:52:37 +00:00
SarahW
93b42d43d5
Remove pointless setting of cpu_state.op32 and cycdiff at start of recompiler main loop.
2019-01-27 20:52:02 +00:00
SarahW
c3250ca63e
Don't set oldcpl at the start of each instruction; instead, only set it following a successful CS load.
2019-01-27 20:51:13 +00:00
SarahW
d461bc7cda
Fix invalid page check in get_phys_noabrt().
2019-01-24 20:36:20 +00:00
SarahW
c1f0b7c35d
Use readlookup cache in get_phys().
2019-01-22 21:41:00 +00:00
SarahW
ec18c8a2fb
Implement more intelligent out-of-memory algorithm.
2019-01-21 21:52:32 +00:00
SarahW
bf392ffd3a
Maintain a list of free code blocks, and allocate new blocks from the list rather than evicting at random.
...
Also maintain a list of memory pages with dirty code blocks that can be evicted. This allows the recompiler to evict dirty blocks in preference to freeing usable blocks when the free list is empty.
Increase the number of available code blocks on x86.
Increase the non-ARM code allocator memory to 128 MB.
This reduces the amount of code block churning when running software with a lot of code, eg Windows XP.
2019-01-19 21:54:14 +00:00
SarahW
c07a3b5311
Free currently allocated memory blocks on CPU reset. Prevents memory leaks when resetting.
2019-01-19 18:08:45 +00:00
SarahW
9c595f4b9b
Add CMPXCHG8B to the K6 timing model.
2019-01-19 18:06:14 +00:00
SarahW
57579cdd07
Add dummy USB and ACPI implementations to VT82C586B. Windows 2000 and XP now work on FIC VA-503+.
2019-01-19 18:05:27 +00:00
SarahW
13087d0031
Added missing codegen allocator files
2019-01-17 18:05:27 +00:00
SarahW
178c9d5c15
Don't write back temporary registers if they won't be read again.
2019-01-16 21:54:10 +00:00
SarahW
ac886c420f
Increase ARMv7 and v8 code block count to the normal default of 16384, now that this no longer leads to a massive increase in memory usage.
2019-01-13 12:58:07 +00:00