From 814ed9bef54ba1211098e8e66efa7d26608fed93 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Wed, 5 Nov 2003 19:49:30 +0000 Subject: [PATCH] New lazyflag testing and fillflags returns the flags Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1404 --- src/cpu/lazyflags.h | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/cpu/lazyflags.h b/src/cpu/lazyflags.h index 79be9fba..c0fd7d4c 100644 --- a/src/cpu/lazyflags.h +++ b/src/cpu/lazyflags.h @@ -27,7 +27,7 @@ Bitu get_SF(void); Bitu get_OF(void); Bitu get_PF(void); -void FillFlags(void); +Bitu FillFlags(void); #include "regs.h" @@ -80,6 +80,23 @@ extern LazyFlags lflags; #define LoadOF SETFLAGBIT(OF,get_OF()); #define LoadAF SETFLAGBIT(AF,get_AF()); +#define TFLG_O (get_OF()) +#define TFLG_NO (!get_OF()) +#define TFLG_B (get_CF()) +#define TFLG_NB (!get_CF()) +#define TFLG_Z (get_ZF()) +#define TFLG_NZ (!get_ZF()) +#define TFLG_BE (get_CF() || get_ZF()) +#define TFLG_NBE (!get_CF() && !get_ZF()) +#define TFLG_S (get_SF()) +#define TFLG_NS (!get_SF()) +#define TFLG_P (get_PF()) +#define TFLG_NP (!get_PF()) +#define TFLG_L ((get_SF()!=0) != (get_OF()!=0)) +#define TFLG_NL ((get_SF()!=0) == (get_OF()!=0)) +#define TFLG_LE (get_ZF() || ((get_SF()!=0) != (get_OF()!=0))) +#define TFLG_NLE (!get_ZF() && ((get_SF()!=0) == (get_OF()!=0))) + //Types of Flag changing instructions enum { t_UNKNOWN=0, @@ -102,8 +119,7 @@ enum { t_RCLb,t_RCLw,t_RCLd, t_RCRb,t_RCRw,t_RCRd, t_NEGb,t_NEGw,t_NEGd, - t_CF,t_ZF, - + t_DSHLw,t_DSHLd, t_DSHRw,t_DSHRd, t_MUL,t_DIV, @@ -111,11 +127,4 @@ enum { t_LASTFLAG }; -INLINE void SetTypeCF(void) { - if (lflags.type!=t_CF) { - lflags.prev_type=lflags.type; - lflags.type=t_CF; - } -} - -#endif \ No newline at end of file +#endif