Commit 7399c5a9beff882e4faa8b08ccedfa4be6491039
1 parent
10f0e412
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
Showing
1 changed file
with
17 additions
and
3 deletions
target-i386/translate.c
@@ -697,7 +697,15 @@ static GenOpFunc *gen_op_dec_ECX[2] = { | @@ -697,7 +697,15 @@ static GenOpFunc *gen_op_dec_ECX[2] = { | ||
697 | gen_op_decl_ECX, | 697 | gen_op_decl_ECX, |
698 | }; | 698 | }; |
699 | 699 | ||
700 | -static GenOpFunc1 *gen_op_string_jnz_sub[2][3] = { | 700 | +#ifdef USE_DIRECT_JUMP |
701 | +typedef GenOpFunc GenOpFuncTB2; | ||
702 | +#define gen_op_string_jnz_sub(nz, ot, tb) gen_op_string_jnz_sub2[nz][ot]() | ||
703 | +#else | ||
704 | +typedef GenOpFunc1 GenOpFuncTB2; | ||
705 | +#define gen_op_string_jnz_sub(nz, ot, tb) gen_op_string_jnz_sub2[nz][ot](tb) | ||
706 | +#endif | ||
707 | + | ||
708 | +static GenOpFuncTB2 *gen_op_string_jnz_sub2[2][3] = { | ||
701 | { | 709 | { |
702 | gen_op_string_jnz_subb, | 710 | gen_op_string_jnz_subb, |
703 | gen_op_string_jnz_subw, | 711 | gen_op_string_jnz_subw, |
@@ -921,7 +929,7 @@ static inline void gen_repz_ ## op(DisasContext *s, int ot, \ | @@ -921,7 +929,7 @@ static inline void gen_repz_ ## op(DisasContext *s, int ot, \ | ||
921 | if (!s->jmp_opt) \ | 929 | if (!s->jmp_opt) \ |
922 | gen_op_string_jnz_sub_im[nz][ot](next_eip); \ | 930 | gen_op_string_jnz_sub_im[nz][ot](next_eip); \ |
923 | else \ | 931 | else \ |
924 | - gen_op_string_jnz_sub[nz][ot]((long)s->tb); \ | 932 | + gen_op_string_jnz_sub(nz, ot, (long)s->tb); \ |
925 | if (!s->jmp_opt) \ | 933 | if (!s->jmp_opt) \ |
926 | gen_op_jz_ecx_im[s->aflag](next_eip); \ | 934 | gen_op_jz_ecx_im[s->aflag](next_eip); \ |
927 | gen_jmp(s, cur_eip); \ | 935 | gen_jmp(s, cur_eip); \ |
@@ -2807,7 +2815,7 @@ static uint8_t *disas_insn(DisasContext *s, uint8_t *pc_start) | @@ -2807,7 +2815,7 @@ static uint8_t *disas_insn(DisasContext *s, uint8_t *pc_start) | ||
2807 | mod = (modrm >> 6) & 3; | 2815 | mod = (modrm >> 6) & 3; |
2808 | rm = modrm & 7; | 2816 | rm = modrm & 7; |
2809 | op = ((b & 7) << 3) | ((modrm >> 3) & 7); | 2817 | op = ((b & 7) << 3) | ((modrm >> 3) & 7); |
2810 | - | 2818 | + |
2811 | if (mod != 3) { | 2819 | if (mod != 3) { |
2812 | /* memory op */ | 2820 | /* memory op */ |
2813 | gen_lea_modrm(s, modrm, ®_addr, &offset_addr); | 2821 | gen_lea_modrm(s, modrm, ®_addr, &offset_addr); |
@@ -4228,6 +4236,12 @@ static uint16_t opc_read_flags[NB_OPS] = { | @@ -4228,6 +4236,12 @@ static uint16_t opc_read_flags[NB_OPS] = { | ||
4228 | [INDEX_op_cmc] = CC_C, | 4236 | [INDEX_op_cmc] = CC_C, |
4229 | [INDEX_op_salc] = CC_C, | 4237 | [INDEX_op_salc] = CC_C, |
4230 | 4238 | ||
4239 | + /* needed for correct flag optimisation before string ops */ | ||
4240 | + [INDEX_op_jz_ecxw] = CC_OSZAPC, | ||
4241 | + [INDEX_op_jz_ecxl] = CC_OSZAPC, | ||
4242 | + [INDEX_op_jz_ecxw_im] = CC_OSZAPC, | ||
4243 | + [INDEX_op_jz_ecxl_im] = CC_OSZAPC, | ||
4244 | + | ||
4231 | #define DEF_READF(SUFFIX)\ | 4245 | #define DEF_READF(SUFFIX)\ |
4232 | [INDEX_op_adcb ## SUFFIX ## _T0_T1_cc] = CC_C,\ | 4246 | [INDEX_op_adcb ## SUFFIX ## _T0_T1_cc] = CC_C,\ |
4233 | [INDEX_op_adcw ## SUFFIX ## _T0_T1_cc] = CC_C,\ | 4247 | [INDEX_op_adcw ## SUFFIX ## _T0_T1_cc] = CC_C,\ |