qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Chinmay Rath <rathc@linux.vnet.ibm.com>
To: Richard Henderson <richard.henderson@linaro.org>,
	Chinmay Rath <rathc@linux.ibm.com>,
	qemu-ppc@nongnu.org
Cc: qemu-devel@nongnu.org, npiggin@gmail.com, danielhb413@gmail.com,
	harshpb@linux.ibm.com
Subject: Re: [PATCH v2 2/4] target/ppc: Move VSX vector with length storage access insns to decodetree.
Date: Tue, 18 Jun 2024 13:49:39 +0530	[thread overview]
Message-ID: <46f033b8-a94c-4479-a9ae-8e8edcbf127d@linux.vnet.ibm.com> (raw)
In-Reply-To: <a50d339b-d44a-41c1-bb28-82eb761771a1@linaro.org>



On 6/17/24 23:27, Richard Henderson wrote:
> On 6/17/24 04:51, Chinmay Rath wrote:
>>
>>
>> Hi Richard,
>> On 6/17/24 00:43, Richard Henderson wrote:
>>> On 6/13/24 02:33, Chinmay Rath wrote:
>>>> +/* EA <- (ra == 0) ? 0 : GPR[ra] */
>>>> +static TCGv do_ea_calc_ra(DisasContext *ctx, int ra)
>>>> +{
>>>> +    TCGv EA;
>>>> +    if (!ra) {
>>>> +        EA = tcg_constant_tl(0);
>>>> +        return EA;
>>>> +    }
>>>> +    EA = tcg_temp_new();
>>>> +    if (NARROW_MODE(ctx)) {
>>>> +        tcg_gen_ext32u_tl(EA, cpu_gpr[ra]);
>>>> +    } else {
>>>> +        tcg_gen_mov_tl(EA, cpu_gpr[ra]);
>>>
>>> Why are you making a copy, rather than just returning cpu_gpr[ra]?
>>> If you need to modify the resulting EA, then you also need to make a 
>>> copy for 0.
>>>
>> Please ignore my previous response.
>> I think do_ea_calc_ra should allow modification to the resulting EA, 
>> hence below change appears more appropriate to me :
>>
>> /* EA <- (ra == 0) ? 0 : GPR[ra] */
>> static TCGv do_ea_calc_ra(DisasContext *ctx, int ra)
>> {
>>      TCGv EA = tcg_temp_new();
>>      if (!ra) {
>>          tcg_gen_movi_tl(EA, 0);
>>          return EA;
>>      }
>>      if (NARROW_MODE(ctx)) {
>>          tcg_gen_ext32u_tl(EA, cpu_gpr[ra]);
>>      } else {
>>          tcg_gen_mov_tl(EA, cpu_gpr[ra]);
>>      }
>>      return EA;
>> }
>
> If that's what's needed by the callers of do_ea_calc_ra, then yes.
> You can drop the first return EA and use else if instead.
Sure.
I shall stick to keeping EA modifiable, (even though it is not modified 
by the callers in this patch),
to allow its proper usage by (p){lx, stx}vp insns in future.

Thanks & Regards,
Chinmay
>
>
> r~



  reply	other threads:[~2024-06-18  8:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13  9:33 [PATCH v2 0/4] Move VSX storage access and compare insns to Chinmay Rath
2024-06-13  9:33 ` [PATCH v2 1/4] target/ppc: Moving VSX scalar storage access insns to decodetree Chinmay Rath
2024-06-13  9:33 ` [PATCH v2 2/4] target/ppc: Move VSX vector with length " Chinmay Rath
2024-06-16 19:13   ` Richard Henderson
2024-06-17 10:40     ` Chinmay Rath
2024-06-17 17:45       ` Richard Henderson
2024-06-18  8:16         ` Chinmay Rath
2024-06-17 11:51     ` Chinmay Rath
2024-06-17 17:57       ` Richard Henderson
2024-06-18  8:19         ` Chinmay Rath [this message]
2024-06-13  9:33 ` [PATCH v2 3/4] target/ppc: Move VSX vector " Chinmay Rath
2024-06-13  9:33 ` [PATCH v2 4/4] target/ppc: Move VSX fp compare " Chinmay Rath

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=46f033b8-a94c-4479-a9ae-8e8edcbf127d@linux.vnet.ibm.com \
    --to=rathc@linux.vnet.ibm.com \
    --cc=danielhb413@gmail.com \
    --cc=harshpb@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rathc@linux.ibm.com \
    --cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).