All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: christophe.lyon@st.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/8] target-arm: fiddle decoding of 64 bit shift by imm and narrow
Date: Tue, 8 Feb 2011 13:49:15 +0000	[thread overview]
Message-ID: <AANLkTi=0mYr1jfaDVYFW7BHcB-PPB60Tg5V_+ioqRnLy@mail.gmail.com> (raw)
In-Reply-To: <1296497206-15643-5-git-send-email-christophe.lyon@st.com>

On 31 January 2011 18:06,  <christophe.lyon@st.com> wrote:
> From: Christophe Lyon <christophe.lyon@st.com>
>
> Tweak decoding of the shift-by-imm and narrow 64 bit insns
> (VSHRN, VRSHRN, VQSHRN, VQSHRUN, VQRSHRN, VQRSHRUN).
>
> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
> ---
>  target-arm/translate.c |   28 ++++++++++++++++++----------
>  1 files changed, 18 insertions(+), 10 deletions(-)
>
> diff --git a/target-arm/translate.c b/target-arm/translate.c
> index 9ca5b82..a614e34 100644
> --- a/target-arm/translate.c
> +++ b/target-arm/translate.c
> @@ -4831,21 +4831,29 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
>                     if (size == 3) {
>                         neon_load_reg64(cpu_V0, rm + pass);
>                         if (q) {
> -                          if (u)
> -                            gen_helper_neon_rshl_u64(cpu_V0, cpu_V0, tmp64);
> -                          else
> -                            gen_helper_neon_rshl_s64(cpu_V0, cpu_V0, tmp64);
> +                            if ((op == 8 && !u) || (op == 9 && u)) {

This patch would improved if you started with:
                int input_unsigned = (op == 8) ? !u : u;
and then used that here and:

> +                            if ((op == 8 && !u) || (op == 9 && u)) {

here...

> +                        gen_neon_shift_narrow(size, tmp, tmp2, q,
> +                                              (op == 8) ? !u : u);

here...

> +                        gen_neon_shift_narrow(size, tmp3, tmp2, q,
> +                                              (op == 8) ? !u : u);

and here.

(What all these things are trying to check is whether the
input elements for the operations are signed or unsigned;
this isn't the same as the u bit, which is whether the output
is unsigned.)

-- PMM

  reply	other threads:[~2011-02-08 13:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31 18:06 [Qemu-devel] [PATCH v2 0/8] target-arm: Fix Neon instructions VQMOVUN VQRSHL VQRSHRN VQRSHRUN VQSHRN VQSHRUN VSLI VSRI christophe.lyon
2011-01-31 18:06 ` [Qemu-devel] [PATCH 1/8] target-arm: Fixes for several shift instructions: VRSHL, VRSHR, VRSHRN, VSHLL, VRSRA christophe.lyon
2011-02-07 15:57   ` Peter Maydell
2011-02-09 12:16     ` Christophe Lyon
2011-01-31 18:06 ` [Qemu-devel] [PATCH 2/8] target-arm: Create and use neon_unarrow_sat* helpers christophe.lyon
2011-01-31 18:06 ` [Qemu-devel] [PATCH 3/8] target-arm: VQRSHRN related changes christophe.lyon
2011-02-08 13:41   ` Peter Maydell
2011-01-31 18:06 ` [Qemu-devel] [PATCH 4/8] target-arm: fiddle decoding of 64 bit shift by imm and narrow christophe.lyon
2011-02-08 13:49   ` Peter Maydell [this message]
2011-01-31 18:06 ` [Qemu-devel] [PATCH 5/8] target-arm: fix neon vqrshl instruction christophe.lyon
2011-01-31 18:06 ` [Qemu-devel] [PATCH 6/8] target-arm: Fix Neon VQ(R)SHRN instructions christophe.lyon
2011-02-07 16:08   ` Peter Maydell
2011-02-07 16:50     ` Christophe Lyon
2011-02-07 17:01       ` Peter Maydell
2011-01-31 18:06 ` [Qemu-devel] [PATCH 7/8] target-arm: implement vsli.64, vsri.64 christophe.lyon
2011-02-07 15:55   ` Peter Maydell
2011-02-07 16:14     ` Peter Maydell
2011-01-31 18:06 ` [Qemu-devel] [PATCH 8/8] target-arm: Fix VQRSHL Neon instructions (signed/unsigned 64 bits and signed 32 bits variants) christophe.lyon
  -- strict thread matches above, loose matches on Subject: below --
2011-01-28 15:50 [Qemu-devel] [PATCH 0/8] target-arm: Fix Neon instructions VQMOVUN VQRSHL VQRSHRN VQRSHRUN VQSHRN VQSHRUN VSLI VSRI christophe.lyon
2011-01-28 15:51 ` [Qemu-devel] [PATCH 4/8] target-arm: fiddle decoding of 64 bit shift by imm and narrow christophe.lyon

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='AANLkTi=0mYr1jfaDVYFW7BHcB-PPB60Tg5V_+ioqRnLy@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=christophe.lyon@st.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 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.