qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Blue Swirl <blauwirbel@gmail.com>
Subject: Re: [Qemu-devel] [5281] Use the new concat_i32_i64 op for std and stda
Date: Mon, 22 Sep 2008 17:47:13 +0100	[thread overview]
Message-ID: <200809221747.13762.paul@codesourcery.com> (raw)
In-Reply-To: <f43fc5580809220914s5edffef3y7c3ad3583aa59fd6@mail.gmail.com>

On Monday 22 September 2008, Blue Swirl wrote:
> On 9/22/08, Thiemo Seufer <ths@networkno.de> wrote:
> > Blue Swirl wrote:
> >  > On 9/21/08, Paul Brook <paul@codesourcery.com> wrote:
> >  > > > Like these patches?
> >  > > >
> >  > >  > +static inline void tcg_gen_concat_i64_i64(TCGv dest, TCGv low,
> >  > >  > TCGv high) +{
> >  > >  > +    TCGv tmp = tcg_temp_new(TCG_TYPE_I64);
> >  > >  > +    tcg_gen_shli_i64(tmp, high, 32);
> >  > >  > +    tcg_gen_or_i64(dest, low, tmp);
> >  > >  > +    tcg_temp_free(tmp);
> >  > >  > +}
> >  > >
> >  > >  This should use concat_i32_i64 on 32-bit hosts.
> >  > >
> >  > >  Ok with that change, the rename I suggested in my previous mail,
> >  > > and if you add documentation to tcg/README.
> >  >
> >  > Updated. I'll run a couple of tests.
> >
> > I noticed I could also use the complement ("split"?) to those
> >  instructions in the mips backend. Maybe the same is true for
> >  sparc.
>
> Currently I'm using the following:
>                         tcg_gen_trunc_i64_tl(cpu_tmp0, cpu_tmp64);
>                         tcg_gen_andi_tl(cpu_tmp0, cpu_tmp0, 0xffffffffULL);
>                         gen_movl_TN_reg(rd + 1, cpu_tmp0);
>                         tcg_gen_shri_i64(cpu_tmp64, cpu_tmp64, 32);
>                         tcg_gen_trunc_i64_tl(cpu_val, cpu_tmp64);
>                         tcg_gen_andi_tl(cpu_val, cpu_val, 0xffffffffULL);
>
> On a 32 bit host a much more efficient method could be used if wrapped in
> an op.

Which bits would be more efficient?

Note that the final andi is superfluous.

Paul

  reply	other threads:[~2008-09-22 16:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-21 14:49 [Qemu-devel] [5281] Use the new concat_i32_i64 op for std and stda Blue Swirl
2008-09-21 15:01 ` Paul Brook
2008-09-21 16:08   ` Blue Swirl
2008-09-21 16:29     ` Blue Swirl
2008-09-21 16:41       ` Paul Brook
2008-09-21 17:02         ` Blue Swirl
2008-09-21 21:19           ` Thiemo Seufer
2008-09-22 16:14             ` Blue Swirl
2008-09-22 16:47               ` Paul Brook [this message]
2008-09-21 16:36     ` Paul Brook

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=200809221747.13762.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=blauwirbel@gmail.com \
    --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).