All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
Cc: peter.maydell@linaro.org, sstabellini@kernel.org,
	sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com,
	alistair@alistair23.me, richard.henderson@linaro.org,
	qemu-devel@nongnu.org, frederic.konrad@adacore.com,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v3 36/38] target-microblaze: Use tcg_gen_movcond in eval_cond_jmp
Date: Thu, 17 May 2018 14:24:28 -0300	[thread overview]
Message-ID: <3a4a9756-0f55-0902-507d-2df1f659f749@amsat.org> (raw)
In-Reply-To: <20180517164239.xyy2gbi5j2uuppix@toto>

On 05/17/2018 01:42 PM, Edgar E. Iglesias wrote:
> On Thu, May 17, 2018 at 11:48:35AM -0300, Philippe Mathieu-Daudé wrote:
>> Hi Edgar,
>>
>> On 05/17/2018 11:22 AM, Philippe Mathieu-Daudé wrote:
>>> On 05/16/2018 03:51 PM, Edgar E. Iglesias wrote:
>>>> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
>>>>
>>>> Cleanup eval_cond_jmp to use tcg_gen_movcond_i64().
>>>> No functional change.
>>>>
>>>> Suggested-by: Richard Henderson <richard.henderson@linaro.org>
>>>> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
>>>> ---
>>>>  target/microblaze/translate.c | 16 ++++++++++------
>>>>  1 file changed, 10 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
>>>> index a846797d9c..78c2855ff0 100644
>>>> --- a/target/microblaze/translate.c
>>>> +++ b/target/microblaze/translate.c
>>>> @@ -1171,12 +1171,16 @@ static inline void eval_cc(DisasContext *dc, unsigned int cc,
>>>>  
>>>>  static void eval_cond_jmp(DisasContext *dc, TCGv_i64 pc_true, TCGv_i64 pc_false)
>>>>  {
>>>> -    TCGLabel *l1 = gen_new_label();
>>>> -    /* Conditional jmp.  */
>>>> -    tcg_gen_mov_i64(cpu_SR[SR_PC], pc_false);
>>>> -    tcg_gen_brcondi_i32(TCG_COND_EQ, env_btaken, 0, l1);
>>>> -    tcg_gen_mov_i64(cpu_SR[SR_PC], pc_true);
>>>> -    gen_set_label(l1);
>>>> +    TCGv_i64 tmp_btaken = tcg_temp_new_i64();
>>>> +    TCGv_i64 tmp_zero = tcg_const_i64(0);
>>
>> Why not use cpu_R[0] directly?
>>
>> I wonder, maybe the current model doesn't not have R0 hardwired to 0?
> 
> It does but cpu_R[0] is 32bit so we would still need a temp to extend it...

Oh true, I missed that. Thanks :)

> 
> Cheers,
> Edgar
> 
>>
>>>> +
>>>> +    tcg_gen_extu_i32_i64(tmp_btaken, env_btaken);
>>>
>>> env_btaken is i32, ok.
>>>
>>> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>>
>>>> +    tcg_gen_movcond_i64(TCG_COND_NE, cpu_SR[SR_PC],
>>>> +                        tmp_btaken, tmp_zero,
>>>> +                        pc_true, pc_false);
>>
>> So we could drop a temp, using:
>>
>>         tcg_gen_movcond_i64(TCG_COND_NE, cpu_SR[SR_PC],
>>                             tmp_btaken, cpu_R[0],
>>                             pc_true, pc_false);
>>
>>>> +
>>>> +    tcg_temp_free_i64(tmp_btaken);
>>>> +    tcg_temp_free_i64(tmp_zero);
>>>>  }
>>>>  
>>>>  static void dec_bcc(DisasContext *dc)
>>>>
> 

  reply	other threads:[~2018-05-17 17:24 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 18:51 [Qemu-devel] [PATCH v3 00/38] target-microblaze: Add support for Extended Addressing Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 01/38] target-microblaze: dec_load: Use bool instead of unsigned int Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 02/38] target-microblaze: dec_store: " Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 03/38] target-microblaze: compute_ldst_addr: Use bool instead of int Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 04/38] target-microblaze: Fallback to our latest CPU version Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 05/38] target-microblaze: Correct special register array sizes Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 06/38] target-microblaze: Correct the PVR array size Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 07/38] target-microblaze: Tighten up TCGv_i32 vs TCGv type usage Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 08/38] target-microblaze: Remove USE_MMU PVR checks Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 09/38] target-microblaze: Conditionalize setting of PVR11_USE_MMU Edgar E. Iglesias
2018-05-17 17:26   ` Richard Henderson
2018-05-17 18:00     ` Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 10/38] target-microblaze: Bypass MMU with MMU_NOMMU_IDX Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 11/38] target-microblaze: Make compute_ldst_addr always use a temp Edgar E. Iglesias
2018-05-17 14:39   ` Philippe Mathieu-Daudé
2018-05-17 16:41     ` Edgar E. Iglesias
2018-05-17 17:14       ` Philippe Mathieu-Daudé
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 12/38] target-microblaze: Remove pointer indirection for ld/st addresses Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 13/38] target-microblaze: Use TCGv for load/store addresses Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 14/38] target-microblaze: Name special registers we support Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 15/38] target-microblaze: Break out trap_userspace() Edgar E. Iglesias
2018-05-17 14:52   ` Philippe Mathieu-Daudé
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 16/38] target-microblaze: Break out trap_illegal() Edgar E. Iglesias
2018-05-17 14:56   ` Philippe Mathieu-Daudé
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 17/38] target-microblaze: dec_msr: Use bool and extract32 Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 18/38] target-microblaze: dec_msr: Reuse more code when reg-decoding Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 19/38] target-microblaze: dec_msr: Fix MTS to FSR Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 20/38] target-microblaze: Make special registers 64-bit Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 21/38] target-microblaze: Setup for 64bit addressing Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 23/38] target-microblaze: Implement MFSE EAR Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 24/38] target-microblaze: mmu: Add R_TBLX_MISS macros Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 25/38] target-microblaze: mmu: Remove unused register state Edgar E. Iglesias
2018-05-17 15:15   ` Philippe Mathieu-Daudé
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 26/38] target-microblaze: mmu: Prepare for 64-bit addresses Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 27/38] target-microblaze: mmu: Add a configurable output address mask Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 28/38] target-microblaze: dec_msr: Plug a temp leak Edgar E. Iglesias
2018-05-17 13:58   ` Philippe Mathieu-Daudé
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 29/38] target-microblaze: Add support for extended access to TLBLO Edgar E. Iglesias
2018-05-16 23:48   ` Alistair Francis
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 30/38] target-microblaze: Allow address sizes between 32 and 64 bits Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 31/38] target-microblaze: Simplify address computation using tcg_gen_addi_i32() Edgar E. Iglesias
2018-05-17 18:19   ` Philippe Mathieu-Daudé
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 32/38] target-microblaze: mmu: Cleanup debug log messages Edgar E. Iglesias
2018-05-16 23:42   ` Alistair Francis
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 33/38] target-microblaze: Use table based condition-codes conversion Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 34/38] target-microblaze: Remove argument b in eval_cc() Edgar E. Iglesias
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 35/38] target-microblaze: Convert env_btarget to i64 Edgar E. Iglesias
2018-05-17 14:28   ` Philippe Mathieu-Daudé
2018-05-17 17:34   ` Richard Henderson
2018-05-17 18:03     ` Edgar E. Iglesias
2018-05-17 20:48       ` Richard Henderson
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 36/38] target-microblaze: Use tcg_gen_movcond in eval_cond_jmp Edgar E. Iglesias
2018-05-17 14:22   ` Philippe Mathieu-Daudé
2018-05-17 14:48     ` Philippe Mathieu-Daudé
2018-05-17 16:42       ` Edgar E. Iglesias
2018-05-17 17:24         ` Philippe Mathieu-Daudé [this message]
2018-05-17 17:36   ` Richard Henderson
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 37/38] target-microblaze: cpu_mmu_index: Fixup indentation Edgar E. Iglesias
2018-05-16 23:49   ` Alistair Francis
2018-05-17 17:38   ` Richard Henderson
2018-05-16 18:51 ` [Qemu-devel] [PATCH v3 38/38] target-microblaze: Consolidate MMU enabled checks Edgar E. Iglesias
2018-05-16 23:51   ` Alistair Francis
2018-05-17 17:39   ` Richard Henderson

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=3a4a9756-0f55-0902-507d-2df1f659f749@amsat.org \
    --to=f4bug@amsat.org \
    --cc=alistair@alistair23.me \
    --cc=edgar.iglesias@gmail.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=frasse.iglesias@gmail.com \
    --cc=frederic.konrad@adacore.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sai.pavan.boddu@xilinx.com \
    --cc=sstabellini@kernel.org \
    /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.