[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL 13/28] target/sparc: convert to DisasJumpType
From: |
Richard Henderson |
Subject: |
[qemu-s390x] [PULL 13/28] target/sparc: convert to DisasJumpType |
Date: |
Wed, 9 May 2018 10:54:43 -0700 |
From: "Emilio G. Cota" <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Cc: Mark Cave-Ayland <address@hidden>
Cc: Artyom Tarasenko <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
target/sparc/translate.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index 5aa367a182..03c6510717 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -30,6 +30,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/translator.h"
#include "exec/log.h"
#include "asi.h"
@@ -69,7 +70,7 @@ typedef struct DisasContext {
target_ulong pc; /* current Program Counter: integer or DYNAMIC_PC */
target_ulong npc; /* next PC: integer or DYNAMIC_PC or JUMP_PC */
target_ulong jump_pc[2]; /* used when JUMP_PC pc value is used */
- int is_br;
+ DisasJumpType is_jmp;
int mem_idx;
bool fpu_enabled;
bool address_mask_32bit;
@@ -995,7 +996,7 @@ static void gen_branch_a(DisasContext *dc, target_ulong pc1)
gen_set_label(l1);
gen_goto_tb(dc, 1, npc + 4, npc + 8);
- dc->is_br = 1;
+ dc->is_jmp = DISAS_NORETURN;
}
static void gen_branch_n(DisasContext *dc, target_ulong pc1)
@@ -1078,7 +1079,7 @@ static void gen_exception(DisasContext *dc, int which)
t = tcg_const_i32(which);
gen_helper_raise_exception(cpu_env, t);
tcg_temp_free_i32(t);
- dc->is_br = 1;
+ dc->is_jmp = DISAS_NORETURN;
}
static void gen_check_align(TCGv addr, int mask)
@@ -3351,7 +3352,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned
int insn)
if (cond == 8) {
/* An unconditional trap ends the TB. */
- dc->is_br = 1;
+ dc->is_jmp = DISAS_NORETURN;
goto jmp_insn;
} else {
/* A conditional trap falls through to the next insn. */
@@ -4331,7 +4332,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned
int insn)
save_state(dc);
gen_op_next_insn();
tcg_gen_exit_tb(0);
- dc->is_br = 1;
+ dc->is_jmp = DISAS_NORETURN;
break;
case 0x6: /* V9 wrfprs */
tcg_gen_xor_tl(cpu_tmp0, cpu_src1, cpu_src2);
@@ -4340,7 +4341,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned
int insn)
save_state(dc);
gen_op_next_insn();
tcg_gen_exit_tb(0);
- dc->is_br = 1;
+ dc->is_jmp = DISAS_NORETURN;
break;
case 0xf: /* V9 sir, nop if user */
#if !defined(CONFIG_USER_ONLY)
@@ -4468,7 +4469,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned
int insn)
save_state(dc);
gen_op_next_insn();
tcg_gen_exit_tb(0);
- dc->is_br = 1;
+ dc->is_jmp = DISAS_NORETURN;
#endif
}
break;
@@ -4624,7 +4625,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned
int insn)
save_state(dc);
gen_op_next_insn();
tcg_gen_exit_tb(0);
- dc->is_br = 1;
+ dc->is_jmp = DISAS_NORETURN;
break;
case 1: // htstate
// XXX gen_op_wrhtstate();
@@ -5690,7 +5691,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned
int insn)
} else if (dc->npc == JUMP_PC) {
/* we can do a static jump */
gen_branch2(dc, dc->jump_pc[0], dc->jump_pc[1], cpu_cond);
- dc->is_br = 1;
+ dc->is_jmp = DISAS_NORETURN;
} else {
dc->pc = dc->npc;
dc->npc = dc->npc + 4;
@@ -5752,6 +5753,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock
* tb)
pc_start = tb->pc;
dc->pc = pc_start;
last_pc = dc->pc;
+ dc->is_jmp = DISAS_NEXT;
dc->npc = (target_ulong) tb->cs_base;
dc->cc_op = CC_OP_DYNAMIC;
dc->mem_idx = tb->flags & TB_FLAG_MMU_MASK;
@@ -5796,7 +5798,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock
* tb)
}
gen_helper_debug(cpu_env);
tcg_gen_exit_tb(0);
- dc->is_br = 1;
+ dc->is_jmp = DISAS_NORETURN;
goto exit_gen_loop;
}
@@ -5808,8 +5810,9 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock
* tb)
disas_sparc_insn(dc, insn);
- if (dc->is_br)
+ if (dc->is_jmp == DISAS_NORETURN) {
break;
+ }
/* if the next PC is different, we abort now */
if (dc->pc != (last_pc + 4))
break;
@@ -5830,7 +5833,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock
* tb)
if (tb_cflags(tb) & CF_LAST_IO) {
gen_io_end();
}
- if (!dc->is_br) {
+ if (dc->is_jmp != DISAS_NORETURN) {
if (dc->pc != DYNAMIC_PC &&
(dc->npc != DYNAMIC_PC && dc->npc != JUMP_PC)) {
/* static PC and NPC: we can use direct chaining */
--
2.17.0
- [qemu-s390x] [PULL 03/28] target/lm32: avoid integer overflow in next_page PC check, (continued)
- [qemu-s390x] [PULL 03/28] target/lm32: avoid integer overflow in next_page PC check, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 04/28] target/xtensa: avoid integer overflow in next_page PC check, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 06/28] target/tilegx: avoid integer overflow in next_page PC check, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 05/28] target/unicore32: avoid integer overflow in next_page PC check, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 07/28] target/microblaze: avoid integer overflow in next_page PC check, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 09/28] target/s390x: avoid integer overflow in next_page PC check, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 08/28] target/arm: avoid integer overflow in next_page PC check, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 10/28] target/mips: avoid integer overflow in next_page PC check, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 11/28] translator: merge max_insns into DisasContextBase, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 12/28] target/sh4: convert to TranslatorOps, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 13/28] target/sparc: convert to DisasJumpType,
Richard Henderson <=
- [qemu-s390x] [PULL 16/28] target/mips: use lookup_and_goto_ptr on BS_STOP, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 14/28] target/sparc: convert to DisasContextBase, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 15/28] target/sparc: convert to TranslatorOps, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 19/28] target/mips: use *ctx for DisasContext, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 20/28] target/mips: convert to TranslatorOps, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 17/28] target/mips: convert to DisasJumpType, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 23/28] target/s390x: convert to TranslatorOps, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 22/28] target/s390x: convert to DisasContextBase, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 24/28] target/openrisc: convert to DisasContextBase, Richard Henderson, 2018/05/09
- [qemu-s390x] [PULL 18/28] target/mips: convert to DisasContextBase, Richard Henderson, 2018/05/09