All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Richard Henderson <rth@twiddle.net>,
	"patches@linaro.org" <patches@linaro.org>
Subject: Re: [Qemu-devel] [PATCH for-2.9 1/2] tcg/sparc: Zero extend data argument to store helpers
Date: Tue, 28 Mar 2017 16:55:39 +0100	[thread overview]
Message-ID: <CAFEAcA-TJOhAuggEdjp0DezGc+H5nq4ftOsrMmq5XLrVMabdQA@mail.gmail.com> (raw)
In-Reply-To: <3d738f84-7708-0578-0e83-5434f43aa928@amsat.org>

On 28 March 2017 at 16:52, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> On 03/27/2017 01:04 PM, Peter Maydell wrote:

> it seems to me easier to read masking op:
>
>     switch (op & MO_SIZE) {
>     case MO_8:
>         tcg_out_arithi(s, r, r, 0xff, ARITH_AND);
>         break;
>     case MO_16:
>         tcg_out_arithi(s, r, r, 16, SHIFT_SLL);
>         tcg_out_arithi(s, r, r, 16, SHIFT_SRL);
>         break;
>     case MO_32:
>         if (SPARC64) {
>             tcg_out_arith(s, r, r, 0, SHIFT_SRL);
>         }
>         break;
>     case MO_64:
>         break;
>     }

Yes, agreed.

>> +}
>> +
>>  static void build_trampolines(TCGContext *s)
>>  {
>>      static void * const qemu_ld_helpers[16] = {
>> @@ -910,6 +935,7 @@ static void build_trampolines(TCGContext *s)
>>          qemu_st_trampoline[i] = s->code_ptr;
>>
>>          if (SPARC64) {
>> +            emit_extend(s, TCG_REG_O2, i);
>
>
> shouldn't be inverting args?

>                emit_extend(s, i, TCG_REG_O2);

emit_extend() takes the TCG reg first and the 'op' second,
so this call is correct...

>>              ra = TCG_REG_O4;
>>          } else {
>>              ra = TCG_REG_O1;
>> @@ -925,6 +951,7 @@ static void build_trampolines(TCGContext *s)
>>                  tcg_out_arithi(s, ra, ra + 1, 32, SHIFT_SRLX);
>>                  ra += 2;
>>              } else {
>> +                emit_extend(s, i, ra);

...but this one isn't; I don't have 32-bit sparc host to test
with so I missed the error.

>>                  ra += 1;
>>              }
>>              /* Skip the oi argument.  */

thanks
-- PMM

  reply	other threads:[~2017-03-28 15:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27 16:04 [Qemu-devel] [PATCH for-2.9 0/2] tcg/sparc: zero extend ld/st helper args Peter Maydell
2017-03-27 16:04 ` [Qemu-devel] [PATCH for-2.9 1/2] tcg/sparc: Zero extend data argument to store helpers Peter Maydell
2017-03-28 15:52   ` Philippe Mathieu-Daudé
2017-03-28 15:55     ` Peter Maydell [this message]
2017-03-27 16:04 ` [Qemu-devel] [PATCH for-2.9 2/2] tcg/sparc: Zero extend address argument to ld/st helpers Peter Maydell
2017-03-27 23:35 ` [Qemu-devel] [PATCH for-2.9 0/2] tcg/sparc: zero extend ld/st helper args Richard Henderson
2017-04-03 12:34   ` Peter Maydell

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=CAFEAcA-TJOhAuggEdjp0DezGc+H5nq4ftOsrMmq5XLrVMabdQA@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=patches@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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.