qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Laurent Vivier" <laurent@vivier.eu>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/6] target/m68k: Optimize get_sr() using deposit_i32()
Date: Mon, 11 Mar 2019 07:52:03 -0700	[thread overview]
Message-ID: <2c509fe1-5ac3-a65f-bdad-fcbcbf54acb4@twiddle.net> (raw)
In-Reply-To: <20190310003428.11723-5-f4bug@amsat.org>

On 3/9/19 4:34 PM, Philippe Mathieu-Daudé wrote:
>  static TCGv gen_get_sr(DisasContext *s)
>  {
> -    TCGv ccr;
> -    TCGv sr;
> +    TCGv dest;
>  
> -    ccr = gen_get_ccr(s);
> -    sr = tcg_temp_new();
> -    tcg_gen_andi_i32(sr, QREG_SR, 0xffe0);
> -    tcg_gen_or_i32(sr, sr, ccr);
> -    tcg_temp_free(ccr);
> -    return sr;
> +    dest = gen_get_ccr(s);
> +    tcg_gen_deposit_i32(dest, dest, QREG_SR, 5, 11);
> +    return dest;

Err.. there's no shift of QREG_SR by 5 in the original.
I think you meant

  tcg_gen_deposit_i32(dest, QREG_SR, dest, 0, 5);

But I'd be surprised if QREG_SR even has those bits set,
and we could elide the ANDI entirely, making this just an OR.


r~

  reply	other threads:[~2019-03-11 14:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-10  0:34 [Qemu-devel] [PATCH 0/6] target/m68k: Optimize few instructions using deposit/extraxt_i32() Philippe Mathieu-Daudé
2019-03-10  0:34 ` [Qemu-devel] [PATCH 1/6] target/m68k: Reduce the l1 TCGLabel scope Philippe Mathieu-Daudé
2019-03-11 14:46   ` Richard Henderson
2019-03-10  0:34 ` [Qemu-devel] [PATCH 2/6] target/m68k: Optimize the partset instruction using deposit_i32() Philippe Mathieu-Daudé
2019-03-11 14:46   ` Richard Henderson
2019-03-10  0:34 ` [Qemu-devel] [PATCH 3/6] target/m68k: Fix a tcg_temp leak Philippe Mathieu-Daudé
2019-03-11 14:48   ` Richard Henderson
2019-03-10  0:34 ` [Qemu-devel] [PATCH 4/6] target/m68k: Optimize get_sr() using deposit_i32() Philippe Mathieu-Daudé
2019-03-11 14:52   ` Richard Henderson [this message]
2019-03-10  0:34 ` [Qemu-devel] [PATCH 5/6] target/m68k: Optimize rotate_x() using extract_i32() Philippe Mathieu-Daudé
2019-03-11 14:59   ` Richard Henderson
2019-03-10  0:34 ` [Qemu-devel] [PATCH 6/6] target/m68k: Reduce the scope of the 'zero' tcg_temp Philippe Mathieu-Daudé
2019-03-11 14:58   ` 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=2c509fe1-5ac3-a65f-bdad-fcbcbf54acb4@twiddle.net \
    --to=rth@twiddle.net \
    --cc=f4bug@amsat.org \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.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).