[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/46] target/i386: prepare for implementation of STOS/SCAS in new
From: |
Paolo Bonzini |
Subject: |
[PULL 18/46] target/i386: prepare for implementation of STOS/SCAS in new decoder |
Date: |
Sun, 31 Dec 2023 09:44:34 +0100 |
Do not use gen_op, and pull the load from the accumulator into
disas_insn.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/tcg/translate.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index e5f71170967..ecbd80a19ad 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -1264,7 +1264,6 @@ static TCGLabel *gen_jz_ecx_string(DisasContext *s)
static void gen_stos(DisasContext *s, MemOp ot)
{
- gen_op_mov_v_reg(s, MO_32, s->T0, R_EAX);
gen_string_movl_A0_EDI(s);
gen_op_st_v(s, ot, s->T0, s->A0);
gen_op_add_reg(s, s->aflag, R_EDI, gen_compute_Dshift(s, ot));
@@ -1282,7 +1281,11 @@ static void gen_scas(DisasContext *s, MemOp ot)
{
gen_string_movl_A0_EDI(s);
gen_op_ld_v(s, ot, s->T1, s->A0);
- gen_op(s, OP_CMPL, ot, R_EAX);
+ tcg_gen_mov_tl(cpu_cc_src, s->T1);
+ tcg_gen_mov_tl(s->cc_srcT, s->T0);
+ tcg_gen_sub_tl(cpu_cc_dst, s->T0, s->T1);
+ set_cc_op(s, CC_OP_SUBB + ot);
+
gen_op_add_reg(s, s->aflag, R_EDI, gen_compute_Dshift(s, ot));
}
@@ -4952,6 +4955,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
case 0xaa: /* stosS */
case 0xab:
ot = mo_b_d(b, dflag);
+ gen_op_mov_v_reg(s, MO_32, s->T0, R_EAX);
if (prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) {
gen_repz_stos(s, ot);
} else {
@@ -4970,6 +4974,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
case 0xae: /* scasS */
case 0xaf:
ot = mo_b_d(b, dflag);
+ gen_op_mov_v_reg(s, MO_32, s->T0, R_EAX);
if (prefixes & PREFIX_REPNZ) {
gen_repz_scas(s, ot, 1);
} else if (prefixes & PREFIX_REPZ) {
--
2.43.0
- [PULL 06/46] target/i386: clean up cpu_cc_compute_all, (continued)
- [PULL 06/46] target/i386: clean up cpu_cc_compute_all, Paolo Bonzini, 2023/12/31
- [PULL 08/46] target/i386: reimplement check for validity of LOCK prefix, Paolo Bonzini, 2023/12/31
- [PULL 09/46] target/i386: avoid trunc and ext for MULX and RORX, Paolo Bonzini, 2023/12/31
- [PULL 10/46] target/i386: rename zext0/zext2 and make them closer to the manual, Paolo Bonzini, 2023/12/31
- [PULL 11/46] target/i386: add X86_SPECIALs for MOVSX and MOVZX, Paolo Bonzini, 2023/12/31
- [PULL 14/46] target/i386: do not clobber T0 on string operations, Paolo Bonzini, 2023/12/31
- [PULL 16/46] target/i386: do not use s->tmp4 for push, Paolo Bonzini, 2023/12/31
- [PULL 15/46] target/i386: split eflags computation out of gen_compute_eflags, Paolo Bonzini, 2023/12/31
- [PULL 12/46] target/i386: do not decode string source/destination into decode->mem, Paolo Bonzini, 2023/12/31
- [PULL 13/46] target/i386: do not clobber A0 in POP translation, Paolo Bonzini, 2023/12/31
- [PULL 18/46] target/i386: prepare for implementation of STOS/SCAS in new decoder,
Paolo Bonzini <=
- [PULL 17/46] target/i386: do not use s->tmp0 for jumps on ECX ==/!= 0, Paolo Bonzini, 2023/12/31
- [PULL 19/46] target/i386: move operand load and writeback out of gen_cmovcc1, Paolo Bonzini, 2023/12/31
- [PULL 21/46] target/i386: introduce flags writeback mechanism, Paolo Bonzini, 2023/12/31
- [PULL 20/46] target/i386: adjust decoding of J operand, Paolo Bonzini, 2023/12/31
- [PULL 34/46] meson: move accelerator dependency checks together, Paolo Bonzini, 2023/12/31
- [PULL 29/46] configure: remove unnecessary subshell, Paolo Bonzini, 2023/12/31
- [PULL 28/46] Makefile: clean qemu-iotests output, Paolo Bonzini, 2023/12/31
- [PULL 38/46] meson: move subdirs to "Collect sources" section, Paolo Bonzini, 2023/12/31
- [PULL 22/46] target/i386: implement CMPccXADD, Paolo Bonzini, 2023/12/31
- [PULL 25/46] meson: fix type of "relocatable" option, Paolo Bonzini, 2023/12/31