diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-01-24 16:24:06 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-01-24 16:24:06 +0000 |
commit | 7399c5a9beff882e4faa8b08ccedfa4be6491039 (patch) | |
tree | adc7f16d6c13ecc94419c4329b4cdaaf84280c8c /target-i386/translate.c | |
parent | 10f0e412f81c40a2b853b0f44708bb92a99cd587 (diff) |
fixed eflags optimisations with string operation (aka linux 2.6.2rc1 fix) - removed warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@585 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/translate.c')
-rw-r--r-- | target-i386/translate.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/target-i386/translate.c b/target-i386/translate.c index cec9a425ac..0bbd160b42 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -697,7 +697,15 @@ static GenOpFunc *gen_op_dec_ECX[2] = { gen_op_decl_ECX, }; -static GenOpFunc1 *gen_op_string_jnz_sub[2][3] = { +#ifdef USE_DIRECT_JUMP +typedef GenOpFunc GenOpFuncTB2; +#define gen_op_string_jnz_sub(nz, ot, tb) gen_op_string_jnz_sub2[nz][ot]() +#else +typedef GenOpFunc1 GenOpFuncTB2; +#define gen_op_string_jnz_sub(nz, ot, tb) gen_op_string_jnz_sub2[nz][ot](tb) +#endif + +static GenOpFuncTB2 *gen_op_string_jnz_sub2[2][3] = { { gen_op_string_jnz_subb, gen_op_string_jnz_subw, @@ -921,7 +929,7 @@ static inline void gen_repz_ ## op(DisasContext *s, int ot, \ if (!s->jmp_opt) \ gen_op_string_jnz_sub_im[nz][ot](next_eip); \ else \ - gen_op_string_jnz_sub[nz][ot]((long)s->tb); \ + gen_op_string_jnz_sub(nz, ot, (long)s->tb); \ if (!s->jmp_opt) \ gen_op_jz_ecx_im[s->aflag](next_eip); \ gen_jmp(s, cur_eip); \ @@ -2807,7 +2815,7 @@ static uint8_t *disas_insn(DisasContext *s, uint8_t *pc_start) mod = (modrm >> 6) & 3; rm = modrm & 7; op = ((b & 7) << 3) | ((modrm >> 3) & 7); - + if (mod != 3) { /* memory op */ gen_lea_modrm(s, modrm, ®_addr, &offset_addr); @@ -4228,6 +4236,12 @@ static uint16_t opc_read_flags[NB_OPS] = { [INDEX_op_cmc] = CC_C, [INDEX_op_salc] = CC_C, + /* needed for correct flag optimisation before string ops */ + [INDEX_op_jz_ecxw] = CC_OSZAPC, + [INDEX_op_jz_ecxl] = CC_OSZAPC, + [INDEX_op_jz_ecxw_im] = CC_OSZAPC, + [INDEX_op_jz_ecxl_im] = CC_OSZAPC, + #define DEF_READF(SUFFIX)\ [INDEX_op_adcb ## SUFFIX ## _T0_T1_cc] = CC_C,\ [INDEX_op_adcw ## SUFFIX ## _T0_T1_cc] = CC_C,\ |