qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>,
	patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 1/2] tcg/arm: Factor out code to emit immediate or reg-reg op
Date: Wed, 26 Sep 2012 20:46:07 +0100	[thread overview]
Message-ID: <CAFEAcA8xXds+wmA-00Amc0120zMYAv0pSbWSoCPaxrg=2ZM_Mw@mail.gmail.com> (raw)
In-Reply-To: <506350EF.8010508@twiddle.net>

On 26 September 2012 20:01, Richard Henderson <rth@twiddle.net> wrote:
> On 09/26/2012 11:48 AM, Peter Maydell wrote:
>>      case INDEX_op_setcond_i32:
>> -        if (const_args[2]) {
>> -            int rot;
>> -            rot = encode_imm(args[2]);
>> -            tcg_out_dat_imm(s, COND_AL, ARITH_CMP, 0,
>> -                            args[1], rotl(args[2], rot) | (rot << 7));
>> -        } else {
>> -            tcg_out_dat_reg(s, COND_AL, ARITH_CMP, 0,
>> -                            args[1], args[2], SHIFT_IMM_LSL(0));
>> -        }
>> +        tcg_out_dat_rI(s, COND_AL, ARITH_CMP, 0,
>> +                       args[1], args[2], const_args[2]);
>>          tcg_out_dat_imm(s, tcg_cond_to_arm_cond[args[3]],
>>                          ARITH_MOV, args[0], 0, 1);
>>          tcg_out_dat_imm(s, tcg_cond_to_arm_cond[tcg_invert_cond(args[3])],
>
> The patch itself is fine.  But as a followup, if movcc is no longer "free",
> then perhaps the setcond sequence is better as
>
>         cmp
>         mov
>         movcc
>
> i.e. the second move is unconditional?  A register renaming OOO core could
> then schedule the mov before the cmp.

Well, maybe. But my bar for changing existing code requires more
proof that it's worth making the change (basically in both cases
I'm optimising for convenience of development). My suspicion
(entirely unbenchmarked) is that at the moment both these sequences
will pan out about the same cost, so we might as well pick the
one that's easiest to code.

-- PMM

  reply	other threads:[~2012-09-26 19:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26 18:48 [Qemu-devel] [PATCH 0/2] tcg/arm: Implement movcond_i32 Peter Maydell
2012-09-26 18:48 ` [Qemu-devel] [PATCH 1/2] tcg/arm: Factor out code to emit immediate or reg-reg op Peter Maydell
2012-09-26 19:01   ` Richard Henderson
2012-09-26 19:46     ` Peter Maydell [this message]
2012-09-27 13:01       ` Peter Maydell
2012-09-27 19:52   ` Aurelien Jarno
2012-09-26 18:48 ` [Qemu-devel] [PATCH 2/2] tcg/arm: Implement movcond_i32 Peter Maydell
2012-09-27  6:33   ` Paolo Bonzini
2012-09-27 14:32     ` Richard Henderson
2012-09-27 19:53   ` Aurelien Jarno
2012-10-12 17:07 ` [Qemu-devel] [PATCH 0/2] " Peter Maydell
2012-10-16 23:24 ` Aurelien Jarno

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='CAFEAcA8xXds+wmA-00Amc0120zMYAv0pSbWSoCPaxrg=2ZM_Mw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=aurelien@aurel32.net \
    --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 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).