From 60292aed8bea3c0b5560817fee24fdd4c2863cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Sun, 22 Jul 2007 18:48:54 +0000 Subject: [PATCH] move part of flags filling into backend; replace simple-function calls with code if possible during flags invalidation pass (thanks to crazyc); work around fpu bug (x86_64 only) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2930 --- src/cpu/core_dynrec.cpp | 1 + src/cpu/core_dynrec/decoder_basic.h | 32 ++++---- src/cpu/core_dynrec/dyn_fpu.h | 2 +- src/cpu/core_dynrec/operators.h | 110 ++++++++++++++-------------- src/cpu/core_dynrec/risc_x64.h | 10 +++ src/cpu/core_dynrec/risc_x86.h | 78 +++++++++++++++++++- 6 files changed, 161 insertions(+), 72 deletions(-) diff --git a/src/cpu/core_dynrec.cpp b/src/cpu/core_dynrec.cpp index 55a631ea..fc7b1a81 100644 --- a/src/cpu/core_dynrec.cpp +++ b/src/cpu/core_dynrec.cpp @@ -48,6 +48,7 @@ #include "debug.h" #include "paging.h" #include "inout.h" +#include "lazyflags.h" #define CACHE_MAXSIZE (4096) #define CACHE_TOTAL (1024*1024*8) diff --git a/src/cpu/core_dynrec/decoder_basic.h b/src/cpu/core_dynrec/decoder_basic.h index 2ec74b85..b8f515bb 100644 --- a/src/cpu/core_dynrec/decoder_basic.h +++ b/src/cpu/core_dynrec/decoder_basic.h @@ -1029,16 +1029,15 @@ static void gen_restore_reg(HostReg reg,HostReg dest_reg) { -#include "lazyflags.h" - // flags optimization functions // they try to find out if a function can be replaced by another // one that does not generate any flags at all static Bitu mf_functions_num=0; static struct { - DRC_PTR_SIZE_IM pos; - Bit32u fct_ptr; + Bit8u* pos; + void* fct_ptr; + Bitu ftype; } mf_functions[64]; static void InitFlagsOptimization(void) { @@ -1051,7 +1050,7 @@ static void InitFlagsOptimization(void) { static void InvalidateFlags(void) { #ifdef DRC_FLAGS_INVALIDATION for (Bitu ct=0; ct