[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/13] target/i386: inline gen_jcc into sole caller
From: |
Paolo Bonzini |
Subject: |
[PATCH 01/13] target/i386: inline gen_jcc into sole caller |
Date: |
Sun, 15 Dec 2024 10:06:00 +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>
---
target/i386/tcg/translate.c | 8 --------
target/i386/tcg/emit.c.inc | 6 +++++-
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 5d729e68c98..298842d46b6 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -1846,14 +1846,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 785ff63f2ac..8d18407facf 100644
--- a/target/i386/tcg/emit.c.inc
+++ b/target/i386/tcg/emit.c.inc
@@ -2276,8 +2276,12 @@ 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.47.1
- [PATCH 00/13] target/i386: optimize string operations, Paolo Bonzini, 2024/12/15
- [PATCH 01/13] target/i386: inline gen_jcc into sole caller,
Paolo Bonzini <=
- [PATCH 03/13] target/i386: unify REP and REPZ/REPNZ generation, Paolo Bonzini, 2024/12/15
- [PATCH 04/13] target/i386: unify choice between single and repeated string instructions, Paolo Bonzini, 2024/12/15
- [PATCH 02/13] target/i386: remove trailing 1 from gen_{j, cmov, set}cc1, Paolo Bonzini, 2024/12/15
- [PATCH 05/13] target/i386: reorganize ops emitted by do_gen_rep, drop repz_opt, Paolo Bonzini, 2024/12/15