From: Richard Henderson <rth@twiddle.net>
To: Sebastian Macke <sebastian@macke.de>
Cc: openrisc@openrisc.net, openrisc@lists.opencores.org,
qemu-devel@nongnu.org, proljc@gmail.com
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 [thread overview]
Message-ID: <527150E2.5070200@twiddle.net> (raw)
In-Reply-To: <1383073495-5332-12-git-send-email-sebastian@macke.de>
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~
next prev parent reply other threads:[~2013-10-30 18:33 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 19:04 [Qemu-devel] [PATCH 00/13] target-openrisc: More optimizations and corrections Sebastian Macke
2013-10-29 19:04 ` [Qemu-devel] [PATCH 01/13] target-openrisc: Implement translation block chaining Sebastian Macke
2013-10-29 19:04 ` [Qemu-devel] [PATCH 02/13] target-openrisc: Separate Delayed slot handling from main loop Sebastian Macke
2013-10-29 19:04 ` [Qemu-devel] [PATCH 03/13] target-openrisc: Separate of load/store instructions Sebastian Macke
2013-10-29 20:05 ` Max Filippov
2013-10-29 21:36 ` Sebastian Macke
2013-10-29 21:49 ` Richard Henderson
2013-10-29 22:55 ` Max Filippov
2013-10-29 23:37 ` Sebastian Macke
2013-10-29 19:04 ` [Qemu-devel] [PATCH 04/13] target-openrisc: sync flags only when necessary Sebastian Macke
2013-10-29 21:51 ` Richard Henderson
2013-10-29 19:04 ` [Qemu-devel] [PATCH 05/13] target-openrisc: Remove TLB flush on exception Sebastian Macke
2013-10-29 19:47 ` Peter Maydell
2013-10-29 22:41 ` Sebastian Macke
2013-11-01 18:58 ` Peter Maydell
2013-11-02 1:21 ` Richard Henderson
2013-11-06 22:59 ` [Qemu-devel] [Openrisc] " Edgar E. Iglesias
2013-11-02 1:29 ` [Qemu-devel] " Richard Henderson
2013-10-29 19:04 ` [Qemu-devel] [PATCH 06/13] target-openrisc: Remove TLB flush from l.rfe instruction Sebastian Macke
2013-10-29 21:01 ` Max Filippov
2013-10-29 21:53 ` Sebastian Macke
2013-10-29 22:20 ` Max Filippov
2013-10-29 23:14 ` Sebastian Macke
2013-10-29 19:04 ` [Qemu-devel] [PATCH 07/13] target-openrisc: Correct l.cmov conditional check Sebastian Macke
2013-10-29 21:15 ` Max Filippov
2013-10-29 21:23 ` Sebastian Macke
2013-10-29 19:04 ` [Qemu-devel] [PATCH 08/13] target-openrisc: Test for Overflow exception statically Sebastian Macke
2013-10-29 21:25 ` Max Filippov
2013-10-29 22:06 ` Sebastian Macke
2013-10-29 19:04 ` [Qemu-devel] [PATCH 09/13] target-openrisc: Add CPU which neglects Carry and Overflow Flag Sebastian Macke
2013-10-30 18:14 ` Richard Henderson
2013-10-30 19:22 ` Sebastian Macke
2013-10-30 19:31 ` Richard Henderson
2013-10-29 19:04 ` [Qemu-devel] [PATCH 10/13] target-openrisc: Correct target number for 64 bit llseek Sebastian Macke
2013-10-29 19:04 ` [Qemu-devel] [PATCH 11/13] target-openrisc: use jmp_pc as flag variable for branches Sebastian Macke
2013-10-30 18:33 ` Richard Henderson [this message]
2013-10-30 19:07 ` Sebastian Macke
2013-10-30 19:32 ` Richard Henderson
2013-10-30 19:47 ` Richard Henderson
2013-10-30 21:08 ` Sebastian Macke
2013-10-30 22:02 ` Richard Henderson
2013-10-31 0:29 ` Sebastian Macke
2013-10-29 19:04 ` [Qemu-devel] [PATCH 12/13] target-openrisc: Add correct gdb information for the pc value Sebastian Macke
2013-10-29 19:04 ` [Qemu-devel] [PATCH 13/13] target-openrisc: Add In-circuit emulator support Sebastian Macke
2013-10-29 19:53 ` [Qemu-devel] [PATCH 00/13] target-openrisc: More optimizations and corrections Peter Maydell
2013-10-29 21:15 ` Max Filippov
2013-10-29 21:22 ` Sebastian Macke
2013-10-31 11:47 ` Jia Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=527150E2.5070200@twiddle.net \
--to=rth@twiddle.net \
--cc=openrisc@lists.opencores.org \
--cc=openrisc@openrisc.net \
--cc=proljc@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=sebastian@macke.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.