qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 3/5] target-arm: convert sar, shl and shr helpers to TCG
Date: Wed, 26 Sep 2012 00:41:34 +0200	[thread overview]
Message-ID: <20120925224134.GA24473@ohm.aurel32.net> (raw)
In-Reply-To: <CAFEAcA-QE3bVW-KdBQ_uf9grXu34x-mXGnxyTd_rmd7dGd1j7g@mail.gmail.com>

On Tue, Sep 25, 2012 at 02:57:20PM +0100, Peter Maydell wrote:
> On 21 September 2012 20:33, Aurelien Jarno <aurelien@aurel32.net> wrote:
> > +static void gen_sar(TCGv dest, TCGv t0, TCGv t1)
> > +{
> > +    TCGv tmp1, tmp2, tmp3;
> > +    tmp1 = tcg_temp_new_i32();
> > +    tcg_gen_andi_i32(tmp1, t1, 0xff);
> > +    tmp2 = tcg_const_i32(0x1f);
> > +    tmp3 = tcg_const_i32(0);
> > +    tcg_gen_movcond_i32(TCG_COND_GTU, tmp1, tmp1, tmp2, tmp2, tmp1);
> > +    tcg_temp_free_i32(tmp3);
> > +    tcg_temp_free_i32(tmp2);
> > +    tcg_gen_andi_i32(tmp1, tmp1, 0x1f);
> > +    tcg_gen_sar_i32(dest, t0, tmp1);
> > +    tcg_temp_free_i32(tmp1);
> > +}
> 
> I don't think you need the "tcg_gen_andi_i32(tmp1, tmp1, 0x1f);"
> for sar, do you? The movcond is doing "shift = (shift > 31) ? 31 : shift"
> so we know it's going to be in [0..31] and the and will do nothing,
> right?
> 

Indeed, that's a leftover from the previous version based on setcond. 
It should be removed.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

  reply	other threads:[~2012-09-25 22:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 19:33 [Qemu-devel] [PATCH v2 0/5] target-arm: misc optimizations Aurelien Jarno
2012-09-21 19:33 ` [Qemu-devel] [PATCH v2 1/5] target-arm: use globals for CC flags Aurelien Jarno
2012-09-25 16:40   ` Peter Maydell
2012-09-21 19:33 ` [Qemu-devel] [PATCH v2 2/5] target-arm: convert add_cc and sub_cc helpers to TCG Aurelien Jarno
2012-09-25 16:40   ` Peter Maydell
2012-09-21 19:33 ` [Qemu-devel] [PATCH v2 3/5] target-arm: convert sar, shl and shr " Aurelien Jarno
2012-09-21 23:14   ` Richard Henderson
2012-09-22  9:33     ` Aurelien Jarno
2012-09-25 13:57   ` Peter Maydell
2012-09-25 22:41     ` Aurelien Jarno [this message]
2012-09-21 19:33 ` [Qemu-devel] [PATCH v2 4/5] target-arm: mark a few integer helpers const and pure Aurelien Jarno
2012-09-25 16:40   ` Peter Maydell
2012-09-21 19:33 ` [Qemu-devel] [PATCH v2 5/5] target-arm: use deposit instead of hardcoded version Aurelien Jarno
2012-09-25 16:41   ` Peter Maydell
2012-09-25 16:39 ` [Qemu-devel] [PATCH v2 0/5] target-arm: misc optimizations 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=20120925224134.GA24473@ohm.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=peter.maydell@linaro.org \
    --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).