diff options
author | Richard Henderson <rth@twiddle.net> | 2015-02-13 12:51:55 -0800 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2015-03-13 12:28:18 -0700 |
commit | 42a268c241183877192c376d03bd9b6d527407c7 (patch) | |
tree | e41a70d15c0a61d4618b08b889ab9dd56df9c35c /target-microblaze/translate.c | |
parent | 3f626793a2182061e3aa50a9e2ed7a322582a60f (diff) | |
download | qemu-42a268c241183877192c376d03bd9b6d527407c7.zip qemu-42a268c241183877192c376d03bd9b6d527407c7.tar.gz qemu-42a268c241183877192c376d03bd9b6d527407c7.tar.bz2 |
tcg: Change translator-side labels to a pointer
This is improved type checking for the translators -- it's no longer
possible to accidentally swap arguments to the branch functions.
Note that the code generating backends still manipulate labels as int.
With notable exceptions, the scope of the change is just a few lines
for each target, so it's not worth building extra machinery to do this
change in per-target increments.
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Cc: Michael Walle <michael@walle.cc>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Cc: Anthony Green <green@moxielogic.com>
Cc: Jia Liu <proljc@gmail.com>
Cc: Alexander Graf <agraf@suse.de>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-microblaze/translate.c')
-rw-r--r-- | target-microblaze/translate.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c index 5ff3833..4068946 100644 --- a/target-microblaze/translate.c +++ b/target-microblaze/translate.c @@ -313,7 +313,7 @@ static void dec_sub(DisasContext *dc) static void dec_pattern(DisasContext *dc) { unsigned int mode; - int l1; + TCGLabel *l1; if ((dc->tb_flags & MSR_EE_FLAG) && (dc->cpu->env.pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK) @@ -1038,7 +1038,7 @@ static void dec_load(DisasContext *dc) static void dec_store(DisasContext *dc) { TCGv t, *addr, swx_addr; - int swx_skip = 0; + TCGLabel *swx_skip = NULL; unsigned int size, rev = 0, ex = 0; TCGMemOp mop; @@ -1192,9 +1192,7 @@ static inline void eval_cc(DisasContext *dc, unsigned int cc, static void eval_cond_jmp(DisasContext *dc, TCGv pc_true, TCGv pc_false) { - int l1; - - l1 = gen_new_label(); + TCGLabel *l1 = gen_new_label(); /* Conditional jmp. */ tcg_gen_mov_tl(cpu_SR[SR_PC], pc_false); tcg_gen_brcondi_tl(TCG_COND_EQ, env_btaken, 0, l1); @@ -1773,10 +1771,8 @@ gen_intermediate_code_internal(MicroBlazeCPU *cpu, TranslationBlock *tb, gen_goto_tb(dc, 0, dc->jmp_pc); dc->is_jmp = DISAS_TB_JUMP; } else if (dc->jmp == JMP_DIRECT_CC) { - int l1; - + TCGLabel *l1 = gen_new_label(); t_sync_flags(dc); - l1 = gen_new_label(); /* Conditional jmp. */ tcg_gen_brcondi_tl(TCG_COND_NE, env_btaken, 0, l1); gen_goto_tb(dc, 1, dc->pc); |