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, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] target-arm: Implement VMULL.P8
Date: Sun, 20 Feb 2011 17:29:21 +0100	[thread overview]
Message-ID: <20110220162921.GE18619@volta.aurel32.net> (raw)
In-Reply-To: <1297364875-12741-1-git-send-email-peter.maydell@linaro.org>

On Thu, Feb 10, 2011 at 07:07:55PM +0000, Peter Maydell wrote:
> Implement VMULL.P8 (the 32x32->64 version of the polynomial multiply
> instruction).
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  target-arm/helpers.h     |    1 +
>  target-arm/neon_helper.c |   30 ++++++++++++++++++++++++++++++
>  target-arm/translate.c   |    6 ++++--
>  3 files changed, 35 insertions(+), 2 deletions(-)

Thanks, applied.

> diff --git a/target-arm/helpers.h b/target-arm/helpers.h
> index 4d0de00..0d37abe 100644
> --- a/target-arm/helpers.h
> +++ b/target-arm/helpers.h
> @@ -275,6 +275,7 @@ DEF_HELPER_2(neon_sub_u16, i32, i32, i32)
>  DEF_HELPER_2(neon_mul_u8, i32, i32, i32)
>  DEF_HELPER_2(neon_mul_u16, i32, i32, i32)
>  DEF_HELPER_2(neon_mul_p8, i32, i32, i32)
> +DEF_HELPER_2(neon_mull_p8, i64, i32, i32)
>  
>  DEF_HELPER_2(neon_tst_u8, i32, i32, i32)
>  DEF_HELPER_2(neon_tst_u16, i32, i32, i32)
> diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c
> index 61890dd..b59ad38 100644
> --- a/target-arm/neon_helper.c
> +++ b/target-arm/neon_helper.c
> @@ -895,6 +895,36 @@ uint32_t HELPER(neon_mul_p8)(uint32_t op1, uint32_t op2)
>      return result;
>  }
>  
> +uint64_t HELPER(neon_mull_p8)(uint32_t op1, uint32_t op2)
> +{
> +    uint64_t result = 0;
> +    uint64_t mask;
> +    uint64_t op2ex = op2;
> +    op2ex = (op2ex & 0xff) |
> +        ((op2ex & 0xff00) << 8) |
> +        ((op2ex & 0xff0000) << 16) |
> +        ((op2ex & 0xff000000) << 24);
> +    while (op1) {
> +        mask = 0;
> +        if (op1 & 1) {
> +            mask |= 0xffff;
> +        }
> +        if (op1 & (1 << 8)) {
> +            mask |= (0xffffU << 16);
> +        }
> +        if (op1 & (1 << 16)) {
> +            mask |= (0xffffULL << 32);
> +        }
> +        if (op1 & (1 << 24)) {
> +            mask |= (0xffffULL << 48);
> +        }
> +        result ^= op2ex & mask;
> +        op1 = (op1 >> 1) & 0x7f7f7f7f;
> +        op2ex <<= 1;
> +    }
> +    return result;
> +}
> +
>  #define NEON_FN(dest, src1, src2) dest = (src1 & src2) ? -1 : 0
>  NEON_VOP(tst_u8, neon_u8, 4)
>  NEON_VOP(tst_u16, neon_u16, 2)
> diff --git a/target-arm/translate.c b/target-arm/translate.c
> index 3087a5d..f640a50 100644
> --- a/target-arm/translate.c
> +++ b/target-arm/translate.c
> @@ -5124,8 +5124,10 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
>                          gen_neon_mull(cpu_V0, tmp, tmp2, size, u);
>                          break;
>                      case 14: /* Polynomial VMULL */
> -                        cpu_abort(env, "Polynomial VMULL not implemented");
> -
> +                        gen_helper_neon_mull_p8(cpu_V0, tmp, tmp2);
> +                        dead_tmp(tmp2);
> +                        dead_tmp(tmp);
> +                        break;
>                      default: /* 15 is RESERVED.  */
>                          return 1;
>                      }
> -- 
> 1.7.1
> 
> 
> 

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

      reply	other threads:[~2011-02-20 16:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-10 19:07 [Qemu-devel] [PATCH] target-arm: Implement VMULL.P8 Peter Maydell
2011-02-20 16:29 ` Aurelien Jarno [this message]

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=20110220162921.GE18619@volta.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=patches@linaro.org \
    --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).