SarahW
9b737f65b1
Fix warnings when compiling codegen_*.c
...
Patch from davefiddes. Original commit message :
This fixes the following warnings:
codegen_allocator.c:
- implict function declaration of rand() due to missing stdlib.h
codegen_backend_x86-64.c:
- implict function declaration of malloc() due to missing stdlib.h
- unused variables in codegen_backend_init()
- invalid typecast in use of host_x86_CALL()
codegen_backend_x86-64-uop.c:
- Remove unused variable declarations in codegen_CALL_FUNC_RESULT(),
codegen_LOAD_SEG(), codegen_OR_IMM(), codegen_XOR() and codegen_XOR_IMM()
- Move debug only variable declarations under the debug conditional define in
codegen_CALL_FUNC_RESULT(), codegen_LOAD_SEG(), codegen_MEM_LOAD_SINGLE(),
codegen_MEM_LOAD_DOUBLE(), codegen_MEM_STORE_SINGLE(),
codegen_MEM_STORE_DOUBLE()
codegen_reg.c:
- Change (int) typecasts to the correct (intptr_t) for small values stored
in a pointer. This fixes a series of 64-bit compilation warnings.
Tests:
- Build with no warnings on Fedora 32 with gcc 10.1
- Boot a Win98 machine with dynamic compilation enabled
2020-07-14 19:54:15 +01:00
SarahW
5e35e48ec7
XMM registers are not preserved across function calls, and should be flushed & discarded by the recompiler prior to calling external functions. Fixes graphics issues in some games (eg World Cup 98 title/menus).
2019-05-05 14:49:10 +01:00
SarahW
b98a6d63b1
Fix up offset calculations in x86-64 absolute address opcode generation, and add pointer to RAM array in NO_IMMEDIATES blocks. Fixes crashes/segfaults with x86-64 recompiler.
2019-04-30 21:20:00 +01:00
SarahW
87031d4d09
Remove readmemb386l() and writememb386l().
2019-02-07 20:18:03 +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
9060f4552f
Remove fake 3-operand instructions in x86-64 backend.
2019-01-28 21:56:57 +00:00
SarahW
ec18c8a2fb
Implement more intelligent out-of-memory algorithm.
2019-01-21 21:52:32 +00:00
SarahW
8998024225
Move GPF and early exit routines out of individual code blocks and into the common helper block.
2019-01-13 12:57:32 +00:00
SarahW
66fba50e06
Add new codegen memory allocator. This allows the recompiler to allocate memory from a central pool as required. This central pool is by default 64 MB on x86, x86-64 and ARMv8, and 32 MB on ARMv7.
...
The current design does not allow for ARMv8 literal pools, therefore these have been removed.
2019-01-12 15:15:43 +00:00
SarahW
56a4d5cf83
Use correct rounding mode on x86 and x86-64 recompiled versions of PF2ID. Fixes rendering errors on Unreal 3DNow! software renderer
2019-01-10 21:33:29 +00:00
SarahW
1953f4afb9
Use mmap() to allocate codeblock memory on x86-64 when not running on Windows.
2018-12-19 22:25:47 +00:00
SarahW
c86b919ed8
Fix writemem functions on x86-64 when !WIN64.
2018-12-19 22:24:40 +00:00
SarahW
e26abe7a1f
Added recompiled versions of 3DNow instructions - PF2ID, PFADD, PFCMPEQ, PFCMPGE, PFCMPGT, PFMAX, PFMIN, PFMUL, PFRCP, PFRCPIT1, PFRCPIT2, PFRSQRT, PFRSQIT1, PFSUB, PFSUBR and PI2FD.
2018-12-14 21:59:03 +00:00
SarahW
9ff1c7f409
Further reductions to codeblock_t size - replace link pointers with uint16_t block indicies, shrink ins to uint8_t, remove endpc. codeblock_t now fits in a 64-byte cacheline on 32-bit platforms.
2018-11-29 20:05:12 +00:00
SarahW
d63176e472
Move dynarec code memory out of codeblock structure.
2018-11-28 18:43:40 +00:00
SarahW
87191dde55
Added recompiled versions of FIST and FISTP.
2018-10-25 20:54:33 +01:00
SarahW
589f50e479
Added recompiled version of FILDq.
2018-10-22 21:23:09 +01:00
SarahW
8a516df476
Added recompiled versions of FLD, FILD, FST and FSTP.
2018-10-17 19:47:04 +01:00
SarahW
78996b3e5c
Added recompiled register versions of FADD, FDIV, FDIVR, FMUL, FSUB and FSUBR.
2018-10-07 22:02:31 +01:00
SarahW
f27b7f757a
Add recompiled versions of mem->reg, reg->mem and imm->mem versions of MOV.
2018-07-25 20:16:58 +01:00
SarahW
ee3f9210dc
Implemented basic register allocation.
...
Mainly handles 'virtual' registers at the moment (eg current and last PC values, segment override status, etc).
2018-06-23 19:04:36 +01:00
SarahW
03fe25d818
First stage of dynamic recompiler rewrite.
...
Basic IR generation calls C implementation of all instructions.
Backend generation implemented for x86, x86-64, ARM and ARM64.
2018-06-17 20:26:15 +01:00