[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/48] target/i386: inline gen_jcc into sole caller
From: |
Paolo Bonzini |
Subject: |
[PULL 02/48] target/i386: inline gen_jcc into sole caller |
Date: |
Fri, 24 Jan 2025 10:43:56 +0100 |
The code of gen_Jcc is very similar to gen_LOOP* and gen_JCXZ, but this
is hidden by gen_jcc.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Link: https://lore.kernel.org/r/20241215090613.89588-2-pbonzini@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/tcg/translate.c | 8 --------
target/i386/tcg/emit.c.inc | 5 ++++-
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index dbc9d637c4b..3b68441a561 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -1847,14 +1847,6 @@ static void gen_conditional_jump_labels(DisasContext *s,
target_long diff,
gen_jmp_rel(s, s->dflag, diff, 0);
}
-static void gen_jcc(DisasContext *s, int b, int diff)
-{
- TCGLabel *l1 = gen_new_label();
-
- gen_jcc1(s, b, l1);
- gen_conditional_jump_labels(s, diff, NULL, l1);
-}
-
static void gen_cmovcc1(DisasContext *s, int b, TCGv dest, TCGv src)
{
CCPrepare cc = gen_prepare_cc(s, b, NULL);
diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc
index c4cc5f48d83..a193d32ca76 100644
--- a/target/i386/tcg/emit.c.inc
+++ b/target/i386/tcg/emit.c.inc
@@ -2297,8 +2297,11 @@ static void gen_IRET(DisasContext *s, X86DecodedInsn
*decode)
static void gen_Jcc(DisasContext *s, X86DecodedInsn *decode)
{
+ TCGLabel *taken = gen_new_label();
+
gen_bnd_jmp(s);
- gen_jcc(s, decode->b & 0xf, decode->immediate);
+ gen_jcc1(s, decode->b & 0xf, taken);
+ gen_conditional_jump_labels(s, decode->immediate, NULL, taken);
}
static void gen_JCXZ(DisasContext *s, X86DecodedInsn *decode)
--
2.48.1
- [PULL 00/48] i386, rust changes for 2024-01-24, Paolo Bonzini, 2025/01/24
- [PULL 01/48] rust: pl011: fix repr(C) for PL011Class, Paolo Bonzini, 2025/01/24
- [PULL 02/48] target/i386: inline gen_jcc into sole caller,
Paolo Bonzini <=
- [PULL 03/48] target/i386: remove trailing 1 from gen_{j, cmov, set}cc1, Paolo Bonzini, 2025/01/24
- [PULL 05/48] target/i386: unify choice between single and repeated string instructions, Paolo Bonzini, 2025/01/24
- [PULL 04/48] target/i386: unify REP and REPZ/REPNZ generation, Paolo Bonzini, 2025/01/24
- [PULL 06/48] target/i386: reorganize ops emitted by do_gen_rep, drop repz_opt, Paolo Bonzini, 2025/01/24
- [PULL 07/48] target/i386: tcg: move gen_set/reset_* earlier in the file, Paolo Bonzini, 2025/01/24
- [PULL 08/48] target/i386: fix RF handling for string instructions, Paolo Bonzini, 2025/01/24
- [PULL 09/48] target/i386: make cc_op handling more explicit for repeated string instructions., Paolo Bonzini, 2025/01/24
- [PULL 10/48] target/i386: do not use gen_op_jz_ecx for repeated string operations, Paolo Bonzini, 2025/01/24
- [PULL 14/48] target/i386: extract common bits of gen_repz/gen_repz_nz, Paolo Bonzini, 2025/01/24
- [PULL 11/48] target/i386: optimize CX handling in repeated string operations, Paolo Bonzini, 2025/01/24