[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 11/13] target-openrisc: use jmp_pc as flag varia
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 11/13] target-openrisc: use jmp_pc as flag variable for branches |
Date: |
Wed, 30 Oct 2013 11:33:06 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 |
On 10/29/2013 12:04 PM, Sebastian Macke wrote:
> {
> int lab = gen_new_label();
> - dc->btaken = tcg_temp_local_new();
> - tcg_gen_movi_tl(jmp_pc, dc->pc+8);
> - tcg_gen_movi_tl(dc->btaken, 0);
> + tcg_gen_movi_tl(jmp_pc, 0);
> tcg_gen_brcondi_i32(op0 == 0x03 ? TCG_COND_NE : TCG_COND_EQ,
> cpu_srf, 0, lab);
> - tcg_gen_movi_tl(dc->btaken, 1);
> tcg_gen_movi_tl(jmp_pc, tmp_pc);
> gen_set_label(lab);
You can now use movcond here:
tcg_gen_movi_i32(jmp_pc, tmp_pc);
tcg_gen_movcond_i32(jmp_pc, cpu_srf, zero, jmp_pc, zero,
op0 == 0x03 ? TCG_COND_NE : TCG_COND_EQ);
Although I'd wonder about just using setcond instead, since I think
the value stored in jmp_pc here is also stored in dc->j_target, leading
to the right behaviour...
> case JUMP_BRANCH:
> {
> int l1 = gen_new_label();
> - tcg_gen_brcondi_tl(TCG_COND_NE, dc->btaken, 0, l1);
> + tcg_gen_brcondi_tl(TCG_COND_NE, jmp_pc, 0, l1);
> gen_goto_tb(dc, 1, dc->pc);
> gen_set_label(l1);
> - tcg_temp_free(dc->btaken);
> gen_goto_tb(dc, 0, dc->j_target);
> break;
... here.
> + case JUMP_BRANCH_DELAYED:
> + {
> + int l1 = gen_new_label();
> + tcg_gen_brcondi_tl(TCG_COND_NE, jmp_pc, 0, l1);
> + gen_goto_tb(dc, 1, dc->pc);
> + gen_set_label(l1);
> + tcg_gen_mov_tl(cpu_pc, jmp_pc);
> + tcg_gen_exit_tb(0);
> + break;
...
> +
> + dc->delayed_branch = !!(dc->tb_flags & D_FLAG);
> + if ((dc->delayed_branch) && (dc->tb_flags&B_FLAG)) {
> + dc->j_state = JUMP_BRANCH_DELAYED;
> + }
> +
And thus I can't see how these additions are actually useful?
If I've missed something, and the last hunk needs to be retained,
then please fix the coding style:
if (dc->delayed_branch && (dc->tb_flags & B_FLAG)) {
r~
- Re: [Qemu-devel] [PATCH 05/13] target-openrisc: Remove TLB flush on exception, (continued)
- [Qemu-devel] [PATCH 11/13] target-openrisc: use jmp_pc as flag variable for branches, Sebastian Macke, 2013/10/29
- Re: [Qemu-devel] [PATCH 11/13] target-openrisc: use jmp_pc as flag variable for branches,
Richard Henderson <=
- Re: [Qemu-devel] [PATCH 11/13] target-openrisc: use jmp_pc as flag variable for branches, Sebastian Macke, 2013/10/30
- Re: [Qemu-devel] [PATCH 11/13] target-openrisc: use jmp_pc as flag variable for branches, Richard Henderson, 2013/10/30
- Re: [Qemu-devel] [PATCH 11/13] target-openrisc: use jmp_pc as flag variable for branches, Richard Henderson, 2013/10/30
- Re: [Qemu-devel] [PATCH 11/13] target-openrisc: use jmp_pc as flag variable for branches, Sebastian Macke, 2013/10/30
- Re: [Qemu-devel] [PATCH 11/13] target-openrisc: use jmp_pc as flag variable for branches, Richard Henderson, 2013/10/30
- Re: [Qemu-devel] [PATCH 11/13] target-openrisc: use jmp_pc as flag variable for branches, Sebastian Macke, 2013/10/30
[Qemu-devel] [PATCH 10/13] target-openrisc: Correct target number for 64 bit llseek, Sebastian Macke, 2013/10/29
[Qemu-devel] [PATCH 13/13] target-openrisc: Add In-circuit emulator support, Sebastian Macke, 2013/10/29
[Qemu-devel] [PATCH 12/13] target-openrisc: Add correct gdb information for the pc value, Sebastian Macke, 2013/10/29
Re: [Qemu-devel] [PATCH 00/13] target-openrisc: More optimizations and corrections, Peter Maydell, 2013/10/29