Commit graph pcem/src/codegen_x86.c
Author SHA1 Message Date
SarahW
40d7e02006 Fixed recompiler bug introduced by REP rework - Windows XP installer works again. 2017-07-28 20:30:10 +01:00
SarahW
a96e87527e Reorganised REP instructions. 2017-07-20 21:06:21 +01:00
SarahW
3a7c4687d6 Reduce self modifying code granularity from 64 bytes to 16. 2017-06-13 21:05:10 +01:00
SarahW
3b4392bcf8 Implemented data misalignment penalties on 486 and later CPUs. 2017-06-04 16:41:33 +01:00
SarahW
fa9d9381b7 Clear flat DS/SS status on segment load during block. Fixes LBA 2. 2017-06-02 22:01:09 +01:00
SarahW
083ca3d4a2 Slight optimisation when DS/SS are 'flat' (base=0, limit=4G). 2017-05-24 21:50:37 +01:00
SarahW
2b892d2a7a Fixed compiler warnings for Windows builds.
Added -Werror to Windows makefiles.
2017-04-11 19:34:41 +01:00
SarahW
e93feecd3b Disable MEM_*_NO_ABRT abort checks on release builds 2016-12-18 15:06:39 +00:00
SarahW
0985952317 Added code generation for RMW versions of ADD/SUB/OR/XOR/AND 2016-11-13 14:30:39 +00:00
SarahW
dd2a608707 x86-32 recompiler performs float->integer rounding by loading FPU control word instead of calling helper function - speedup on some stuff. 2016-09-18 14:57:10 +01:00
SarahW
aab2c3e7cf Don't inline memory read/write code in x86-32 recompiled blocks - speedup (up to 20% seen) 2016-09-15 21:06:28 +01:00
SarahW
75f9316c11 x86-32 recompiler compiles FPU instructions using direct access to register stack when top-of-stack is static. Minor speedup. 2016-09-11 15:38:05 +01:00
SarahW
5a02b518b8 Moved FPU register stack into cpu_state structure.
Fixed a couple of FPU bugs in x86-64 recompiler that were introduced in rev 543, fixes lightmap issues in Half-Life.
2016-08-25 21:09:02 +01:00
SarahW
eb126fd822 Moved more variables into cpu_state structure. 2016-08-21 21:28:23 +01:00
SarahW
c664682758 Move some more variables into cpu_state structure. Minor speedup (~2%). 2016-08-17 21:28:16 +01:00
SarahW
535604b760 Pack decoded ModR/M data into a single word - minor recompiler speedup. 2016-08-14 16:29:54 +01:00
SarahW
31298d6be1 Recompiler no longer sets tempc variable before calling opcode routine. 2016-08-14 11:22:07 +01:00
SarahW
81b1bfc07f Fix self-modifying code bug, Windows 3.1 works again. 2016-08-01 15:04:17 +01:00
SarahW
42237ac1f8 Recompiler now only recompiles a block after seeing it twice. Improves performance on stuff that uses self modifying code - eg Doom, Duke Nukem 3D, Windows 95 idle 2016-07-31 12:33:37 +01:00
SarahW
a151e90aeb x86 recompiler now saves/restores correct registers on entry/exit of code block. 2016-05-07 15:34:08 +01:00
SarahW
153c22e442 Cyrix 6x86 emulation. Based on patch from leilei.
Moved MOV TRx, reg to correct opcode - required by Award 430VX BIOS with 6x86.
2016-04-27 22:23:49 +01:00
SarahW
c81a91fd72 Moved integer registers, PC and flags_* variables into new cpu_state structure. Reduces recompiled code size slightly, small speedup (1-3%). 2016-04-20 21:39:41 +01:00
SarahW
36bb949126 If recompiler block hash table points to wrong block, then walk tree to find correct block instead of recompiling. Speedups of 10-20% on games that were seeing hash aliasing, eg Quake III, System Shock 2, UltraHLE etc 2016-04-06 20:48:36 +01:00
TomW
4011a246ff Added code generation for MMX instructions 2016-02-24 20:55:48 +00:00
TomW
38fb86cb95 stack32 is now always 0 or 1, to prevent failed comparisons in 386_dynarec.c.
Only clear an entry in codeblock_hash if it's pointing to the block actually being deleted.
Speeds up menus in Railroad Tycoon II significantly.
2016-01-23 14:36:59 +00:00
TomW
4c8e892872 Windows x86 32-bit recompiler should now work with DEP enabled. 2015-09-03 18:35:58 +01:00
TomW
f339f00315 Interpreter and dynamic recompiler now present in a single binary. 2015-08-21 20:55:36 +01:00
TomW
d79814692f Flush memory->codeblock list heads on CPU reset - fixes "block->next->pc=0" errors on reset on some machines. 2015-07-12 14:53:03 +01:00
TomW
51489d031c Reduced number of segment/selector checks in recompiler - minor speedup. 2015-07-08 20:40:37 +01:00
TomW
f3607c2308 Added code generation for :
- FCOM/FUCOM
- FSUBR/FSUBRP/FDIVR/FDIVRP
- FLDCW/FSTCW
- FILD/FIST/FISTP (16-bit, 32-bit and 64-bit variants)
- FLD/FST/FSTP double precision
- Integer and double precision variants of FADD/FSUB/FMUL/FDIV
Also added 64-bit readmemq/writememq functions.
2015-06-13 16:14:35 +01:00
TomW
9061c5d2fc Added code generation for :
- TEST immediate
- register versions of NOT and NEG
- fixed shift versions of SHL, SHR and SAR
- MOVZX and MOVSX
- LEA
- CMP with memory destination
- JL, JNL, JLE, JNLE, JBE, JNBE
2015-05-30 17:08:54 +01:00
TomW
15bca849c8 Added code generation for first batch of FPU instructions; instructions added are most common instructions used in Quake. 2015-04-19 08:42:04 +01:00
TomW
bbf0011e95 Added code generation for JCXZ, LOOP, JE, JNE, JS, JNS, JB, JNB, JO, JNO, JP and JNP. 2015-04-14 20:40:40 +01:00
TomW
1fb4de4507 Dynamic recompiler now works on Linux (32-bit only) 2015-04-11 18:31:51 +01:00
TomW
6caeca2c7c Tweaks to generated code, should reduce size slightly. 2015-04-11 16:06:50 +01:00
TomW
1098b1f870 Fixed stupid typo which broke hard reset with dynamic recompiler. 2015-04-01 19:38:22 +01:00
TomW
a97e89e857 Added code generation for register and immediate PUSH/POP, RET, relative CALL and JMP instructions. 2015-03-30 20:42:33 +01:00
TomW
faec4da733 All CALL/RET/JMP/IRET/INT instruction cycles should now be counted in recompiler. 2015-03-09 19:54:02 +00:00
TomW
ba715706b6 Added code generation for memory versions of MOV, and memory source versions of ADD, SUB, AND, OR, XOR and CMP. 2015-02-08 17:17:14 +00:00
TomW
b4592cdea3 Implemented new memory mapping to improve performance of self modifying code.
New scheme allows code blocks to cross pages.
Reduced code block size down to 2kB.
2015-01-28 21:58:02 +00:00
TomW
630592125c Added code generation for immediate->register and register versions of MOV, XCHG, ADD, SUB, AND, OR, XOR, TEST, CMP, INC and DEC. 2015-01-16 21:22:14 +00:00
TomW
4855071ead Effective address calculations now implemented by recompiled code. Up to 30% performance gain seen. 2014-11-30 17:48:10 +00:00
TomW
13226a2bd4 Added Pentium and Pentium MMX emulation. 2014-11-17 20:41:02 +00:00
TomW
2905c43db8 Cycle counts for recompiled blocks now generated at compile time. 2014-11-12 19:33:49 +00:00
TomW
087f412d3f Reorganised FPU emulation. 2014-11-09 14:07:03 +00:00
TomW
4676daade4 Initial commit of dynamic recompiler.
Various CPU changes to support dynamic recompiler.
2014-11-05 21:24:16 +00:00