[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-9.1 10/19] target/i386: generalize gen_movl_seg_T0
From: |
Zhao Liu |
Subject: |
Re: [PATCH for-9.1 10/19] target/i386: generalize gen_movl_seg_T0 |
Date: |
Thu, 11 Apr 2024 22:45:56 +0800 |
Hi Paolo,
On Tue, Apr 09, 2024 at 06:43:14PM +0200, Paolo Bonzini wrote:
> Date: Tue, 9 Apr 2024 18:43:14 +0200
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH for-9.1 10/19] target/i386: generalize gen_movl_seg_T0
> X-Mailer: git-send-email 2.44.0
>
> In the new decoder it is sometimes easier to put the segment
> in T1 instead of T0, usually because another operand was loaded
> by common code in T0. Genrealize gen_movl_seg_T0 to allow
> using any source.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> target/i386/tcg/translate.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
> index de1ccb6ea7f..8a34e50c452 100644
> --- a/target/i386/tcg/translate.c
> +++ b/target/i386/tcg/translate.c
> @@ -2531,12 +2531,12 @@ static void gen_op_movl_seg_real(DisasContext *s,
> X86Seg seg_reg, TCGv seg)
> tcg_gen_shli_tl(cpu_seg_base[seg_reg], selector, 4);
> }
>
> -/* move T0 to seg_reg and compute if the CPU state may change. Never
> +/* move SRC to seg_reg and compute if the CPU state may change. Never
> call this function with seg_reg == R_CS */
> -static void gen_movl_seg_T0(DisasContext *s, X86Seg seg_reg)
> +static void gen_movl_seg(DisasContext *s, X86Seg seg_reg, TCGv src)
> {
> if (PE(s) && !VM86(s)) {
> - tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0);
> + tcg_gen_trunc_tl_i32(s->tmp2_i32, src);
> gen_helper_load_seg(tcg_env, tcg_constant_i32(seg_reg), s->tmp2_i32);
> /* abort translation because the addseg value may change or
> because ss32 may change. For R_SS, translation must always
This patch missed to include another gen_movl_seg_T0() use in emit.c.inc,
which was cleaned up later in patch 11. We could move that cleanup into
this patch to avoid compiling failures.
-Zhao
- [PATCH for-9.1 04/19] target/i386: do not use s->tmp0 and s->tmp4 to compute flags, (continued)
- [PATCH for-9.1 04/19] target/i386: do not use s->tmp0 and s->tmp4 to compute flags, Paolo Bonzini, 2024/04/09
- [PATCH for-9.1 06/19] target/i386: move 00-5F opcodes to new decoder, Paolo Bonzini, 2024/04/09
- [PATCH for-9.1 05/19] target/i386: reintroduce debugging mechanism, Paolo Bonzini, 2024/04/09
- [PATCH for-9.1 07/19] target/i386: extract gen_far_call/jmp, reordering temporaries, Paolo Bonzini, 2024/04/09
- [PATCH for-9.1 10/19] target/i386: generalize gen_movl_seg_T0, Paolo Bonzini, 2024/04/09
- [PATCH for-9.1 08/19] target/i386: allow instructions with more than one immediate, Paolo Bonzini, 2024/04/09
- [PATCH for-9.1 13/19] target/i386: move remaining conditional operations to new decoder, Paolo Bonzini, 2024/04/09
- [PATCH for-9.1 09/19] target/i386: move 60-BF opcodes to new decoder, Paolo Bonzini, 2024/04/09