qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-arm: Correct conversion of Thumb Neon dp encodings into ARM
@ 2011-02-11 13:35 Peter Maydell
  2011-02-20 16:31 ` Aurelien Jarno
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2011-02-11 13:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

From: Juha Riihimäki <juha.riihimaki@nokia.com>

We handle Thumb Neon data processing instructions by converting them
into the equivalent ARM encoding, as the two are very close. However
the ARM encoding should have bit 28 set, not clear. This wasn't causing
any problems because we don't actually look at that bit during decode;
however it is better to do the conversion correctly to avoid problems
later if we add checks to UNDEF on SBZ/SBO bits.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/translate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 3087a5d..793fd59 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -8011,7 +8011,7 @@ static int disas_thumb2_insn(CPUState *env, DisasContext *s, uint16_t insn_hw1)
         /* Coprocessor.  */
         if (((insn >> 24) & 3) == 3) {
             /* Translate into the equivalent ARM encoding.  */
-            insn = (insn & 0xe2ffffff) | ((insn & (1 << 28)) >> 4);
+            insn = (insn & 0xe2ffffff) | ((insn & (1 << 28)) >> 4) | (1 << 28);
             if (disas_neon_data_insn(env, s, insn))
                 goto illegal_op;
         } else {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] target-arm: Correct conversion of Thumb Neon dp encodings into ARM
  2011-02-11 13:35 [Qemu-devel] [PATCH] target-arm: Correct conversion of Thumb Neon dp encodings into ARM Peter Maydell
@ 2011-02-20 16:31 ` Aurelien Jarno
  0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2011-02-20 16:31 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, patches

On Fri, Feb 11, 2011 at 01:35:25PM +0000, Peter Maydell wrote:
> From: Juha Riihimäki <juha.riihimaki@nokia.com>
> 
> We handle Thumb Neon data processing instructions by converting them
> into the equivalent ARM encoding, as the two are very close. However
> the ARM encoding should have bit 28 set, not clear. This wasn't causing
> any problems because we don't actually look at that bit during decode;
> however it is better to do the conversion correctly to avoid problems
> later if we add checks to UNDEF on SBZ/SBO bits.
> 
> Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  target-arm/translate.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Thanks, applied.

> diff --git a/target-arm/translate.c b/target-arm/translate.c
> index 3087a5d..793fd59 100644
> --- a/target-arm/translate.c
> +++ b/target-arm/translate.c
> @@ -8011,7 +8011,7 @@ static int disas_thumb2_insn(CPUState *env, DisasContext *s, uint16_t insn_hw1)
>          /* Coprocessor.  */
>          if (((insn >> 24) & 3) == 3) {
>              /* Translate into the equivalent ARM encoding.  */
> -            insn = (insn & 0xe2ffffff) | ((insn & (1 << 28)) >> 4);
> +            insn = (insn & 0xe2ffffff) | ((insn & (1 << 28)) >> 4) | (1 << 28);
>              if (disas_neon_data_insn(env, s, insn))
>                  goto illegal_op;
>          } else {
> -- 
> 1.7.1
> 
> 
> 

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-20 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-11 13:35 [Qemu-devel] [PATCH] target-arm: Correct conversion of Thumb Neon dp encodings into ARM Peter Maydell
2011-02-20 16:31 ` Aurelien Jarno

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).