qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <andreas.faerber@web.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Anthony Liguori <aliguori@us.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/7] target-arm: Add ARM UDIV/SDIV support
Date: Sun, 23 Oct 2011 02:20:19 +0200	[thread overview]
Message-ID: <4EA35DC3.90203@web.de> (raw)
In-Reply-To: <1319116568-2663-5-git-send-email-peter.maydell@linaro.org>

Am 20.10.2011 15:16, schrieb Peter Maydell:
> Add support for UDIV and SDIV in ARM mode. This is a new optional
> feature for A profile cores (Thumb mode has had UDIV and SDIV for
> M profile cores for some time).
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Lightly ...

Tested-by: Andreas Färber <andreas.faerber@web.de>

Andreas

> ---
>  target-arm/cpu.h       |    1 +
>  target-arm/helper.c    |    5 ++++-
>  target-arm/translate.c |   19 +++++++++++++++++++
>  3 files changed, 24 insertions(+), 1 deletions(-)
> 
> diff --git a/target-arm/cpu.h b/target-arm/cpu.h
> index 00e012e..af3904d 100644
> --- a/target-arm/cpu.h
> +++ b/target-arm/cpu.h
> @@ -375,6 +375,7 @@ enum arm_features {
>      ARM_FEATURE_V5,
>      ARM_FEATURE_STRONGARM,
>      ARM_FEATURE_VAPA, /* cp15 VA to PA lookups */
> +    ARM_FEATURE_ARM_DIV, /* divide supported in ARM encoding */
>  };
>  
>  static inline int arm_feature(CPUARMState *env, int feature)
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index faf0283..3a51fd7 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
> @@ -207,7 +207,7 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
>          set_feature(env, ARM_FEATURE_VFP_FP16);
>          set_feature(env, ARM_FEATURE_NEON);
>          set_feature(env, ARM_FEATURE_THUMB2EE);
> -        set_feature(env, ARM_FEATURE_THUMB_DIV);
> +        set_feature(env, ARM_FEATURE_ARM_DIV);
>          set_feature(env, ARM_FEATURE_V7MP);
>          break;
>      case ARM_CPUID_TI915T:
> @@ -261,6 +261,9 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
>      if (arm_feature(env, ARM_FEATURE_V7)) {
>          set_feature(env, ARM_FEATURE_VAPA);
>      }
> +    if (arm_feature(env, ARM_FEATURE_ARM_DIV)) {
> +        set_feature(env, ARM_FEATURE_THUMB_DIV);
> +    }
>  }
>  
>  void cpu_reset(CPUARMState *env)
> diff --git a/target-arm/translate.c b/target-arm/translate.c
> index deb0bcf..812a9e7 100644
> --- a/target-arm/translate.c
> +++ b/target-arm/translate.c
> @@ -7639,6 +7639,25 @@ static void disas_arm_insn(CPUState * env, DisasContext *s)
>                              store_reg(s, rn, tmp);
>                          }
>                          break;
> +                    case 1:
> +                    case 3:
> +                        /* SDIV, UDIV */
> +                        if (!arm_feature(env, ARM_FEATURE_ARM_DIV)) {
> +                            goto illegal_op;
> +                        }
> +                        if (((insn >> 5) & 7) || (rd != 15)) {
> +                            goto illegal_op;
> +                        }
> +                        tmp = load_reg(s, rm);
> +                        tmp2 = load_reg(s, rs);
> +                        if (insn & (1 << 21)) {
> +                            gen_helper_udiv(tmp, tmp, tmp2);
> +                        } else {
> +                            gen_helper_sdiv(tmp, tmp, tmp2);
> +                        }
> +                        tcg_temp_free_i32(tmp2);
> +                        store_reg(s, rn, tmp);
> +                        break;
>                      default:
>                          goto illegal_op;
>                      }

  reply	other threads:[~2011-10-23  0:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-20 13:16 [Qemu-devel] [PULL 0/7] target-arm queue Peter Maydell
2011-10-20 13:16 ` [Qemu-devel] [PATCH 1/7] rsqrte_f32: No need to copy sign bit Peter Maydell
2011-10-20 13:16 ` [Qemu-devel] [PATCH 2/7] target-arm: v6 media multiply space: UNDEF on unassigned encodings Peter Maydell
2011-10-20 13:16 ` [Qemu-devel] [PATCH 3/7] target-arm: Rename ARM_FEATURE_DIV to _THUMB_DIV Peter Maydell
2011-10-23  0:04   ` Andreas Färber
2011-10-20 13:16 ` [Qemu-devel] [PATCH 4/7] target-arm: Add ARM UDIV/SDIV support Peter Maydell
2011-10-23  0:20   ` Andreas Färber [this message]
2011-10-20 13:16 ` [Qemu-devel] [PATCH 5/7] softfloat: Implement fused multiply-add Peter Maydell
2011-10-20 13:16 ` [Qemu-devel] [PATCH 6/7] target-arm: Implement VFPv4 fused multiply-accumulate insns Peter Maydell
2011-10-20 13:16 ` [Qemu-devel] [PATCH 7/7] target-arm/machine.c: Restore VFP registers correctly 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=4EA35DC3.90203@web.de \
    --to=andreas.faerber@web.de \
    --cc=aliguori@us.ibm.com \
    --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).