[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v9 14/26] target: [tcg, i386] Replace DISAS_* with D
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH v9 14/26] target: [tcg, i386] Replace DISAS_* with DJ_* |
Date: |
Sun, 25 Jun 2017 12:40:14 +0300 |
User-agent: |
StGit/0.17.1-dirty |
Incrementally paves the way towards using the generic instruction translation
loop.
Signed-off-by: Lluís Vilanova <address@hidden>
---
target/i386/translate.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/target/i386/translate.c b/target/i386/translate.c
index 5e426de947..c7bb6efbf5 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -71,6 +71,9 @@
case (2 << 6) | (OP << 3) | 0 ... (2 << 6) | (OP << 3) | 7: \
case (3 << 6) | (OP << 3) | 0 ... (3 << 6) | (OP << 3) | 7
+#define DJ_JUMP (DJ_TARGET + 0) /* end of block due to call/jump */
+#define DJ_MISC (DJ_TARGET + 1) /* some other reason */
+
//#define MACRO_TEST 1
/* global register indexes */
@@ -2180,7 +2183,7 @@ static inline void gen_jcc(DisasContext *s, int b,
gen_set_label(l1);
gen_goto_tb(s, 1, val);
- s->base.is_jmp = DISAS_TB_JUMP;
+ s->base.is_jmp = DJ_JUMP;
} else {
l1 = gen_new_label();
l2 = gen_new_label();
@@ -2253,11 +2256,11 @@ static void gen_movl_seg_T0(DisasContext *s, int
seg_reg)
stop as a special handling must be done to disable hardware
interrupts for the next instruction */
if (seg_reg == R_SS || (s->code32 && seg_reg < R_FS))
- b->is_jmp = DISAS_TB_JUMP;
+ b->is_jmp = DJ_JUMP;
} else {
gen_op_movl_seg_T0_vm(seg_reg);
if (seg_reg == R_SS)
- b->is_jmp = DISAS_TB_JUMP;
+ b->is_jmp = DJ_JUMP;
}
}
@@ -2431,7 +2434,7 @@ static void gen_exception(DisasContext *s, int trapno,
target_ulong cur_eip)
gen_update_cc_op(s);
gen_jmp_im(cur_eip);
gen_helper_raise_exception(cpu_env, tcg_const_i32(trapno));
- b->is_jmp = DISAS_TB_JUMP;
+ b->is_jmp = DJ_JUMP;
}
/* Generate #UD for the current instruction. The assumption here is that
@@ -2471,7 +2474,7 @@ static void gen_interrupt(DisasContext *s, int intno,
gen_jmp_im(cur_eip);
gen_helper_raise_interrupt(cpu_env, tcg_const_i32(intno),
tcg_const_i32(next_eip - cur_eip));
- b->is_jmp = DISAS_TB_JUMP;
+ b->is_jmp = DJ_JUMP;
}
static void gen_debug(DisasContext *s, target_ulong cur_eip)
@@ -2481,7 +2484,7 @@ static void gen_debug(DisasContext *s, target_ulong
cur_eip)
gen_update_cc_op(s);
gen_jmp_im(cur_eip);
gen_helper_debug(cpu_env);
- b->is_jmp = DISAS_TB_JUMP;
+ b->is_jmp = DJ_JUMP;
}
static void gen_set_hflag(DisasContext *s, uint32_t mask)
@@ -2558,7 +2561,7 @@ do_gen_eob_worker(DisasContext *s, bool inhibit, bool
recheck_tf, TCGv jr)
} else {
tcg_gen_exit_tb(0);
}
- b->is_jmp = DISAS_TB_JUMP;
+ b->is_jmp = DJ_JUMP;
}
static inline void
@@ -2599,7 +2602,7 @@ static void gen_jmp_tb(DisasContext *s, target_ulong eip,
int tb_num)
set_cc_op(s, CC_OP_DYNAMIC);
if (s->jmp_opt) {
gen_goto_tb(s, tb_num, eip);
- b->is_jmp = DISAS_TB_JUMP;
+ b->is_jmp = DJ_JUMP;
} else {
gen_jmp_im(eip);
gen_eob(s);
@@ -6963,7 +6966,7 @@ static target_ulong disas_insn(DisasContextBase *db,
CPUState *cpu)
gen_update_cc_op(s);
gen_jmp_im(pc_start - s->cs_base);
gen_helper_pause(cpu_env, tcg_const_i32(s->pc - pc_start));
- db->is_jmp = DISAS_TB_JUMP;
+ db->is_jmp = DJ_JUMP;
}
break;
case 0x9b: /* fwait */
@@ -7208,7 +7211,7 @@ static target_ulong disas_insn(DisasContextBase *db,
CPUState *cpu)
gen_update_cc_op(s);
gen_jmp_im(pc_start - s->cs_base);
gen_helper_hlt(cpu_env, tcg_const_i32(s->pc - pc_start));
- db->is_jmp = DISAS_TB_JUMP;
+ db->is_jmp = DJ_JUMP;
}
break;
case 0x100:
@@ -7391,7 +7394,7 @@ static target_ulong disas_insn(DisasContextBase *db,
CPUState *cpu)
gen_helper_vmrun(cpu_env, tcg_const_i32(s->aflag - 1),
tcg_const_i32(s->pc - pc_start));
tcg_gen_exit_tb(0);
- db->is_jmp = DISAS_TB_JUMP;
+ db->is_jmp = DJ_JUMP;
break;
case 0xd9: /* VMMCALL */
@@ -8567,7 +8570,7 @@ void gen_intermediate_code(CPUState *cpu,
TranslationBlock *tb)
/* generate intermediate code */
db->singlestep_enabled = cpu->singlestep_enabled;
db->tb = tb;
- db->is_jmp = DISAS_NEXT;
+ db->is_jmp = DJ_NEXT;
db->pc_first = tb->pc;
db->pc_next = db->pc_first;
i386_trblock_init_disas_context(db, cpu);
- Re: [Qemu-devel] [PATCH v9 06/26] target: [tcg, i386] Port to DisasContextBase, (continued)
- [Qemu-devel] [PATCH v9 07/26] target: [tcg, i386] Refactor init_disas_context, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 08/26] target: [tcg, i386] Refactor init_globals, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 09/26] target: [tcg, i386] Refactor insn_start, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 10/26] target: [tcg, i386] Refactor breakpoint_check, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 11/26] target: [tcg, i386] Refactor disas_insn, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 12/26] target: [tcg,i386] Refactor tb_stop, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 13/26] target: [tcg, i386] Refactor disas_flags, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 14/26] target: [tcg, i386] Replace DISAS_* with DJ_*,
Lluís Vilanova <=
- [Qemu-devel] [PATCH v9 16/26] target: [tcg, arm] Replace DISAS_* with DJ_*, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 17/26] target: [tcg, arm] Port to DisasContextBase, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 18/26] target: [tcg, arm] Port to init_disas_context, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 19/26] target: [tcg, arm] Port to init_globals, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 20/26] target: [tcg,arm] Port to tb_start, Lluís Vilanova, 2017/06/25
- [Qemu-devel] [PATCH v9 21/26] target: [tcg, arm] Port to insn_start, Lluís Vilanova, 2017/06/25