diff mbox

[001/399] target-arm: Fix handling of AL condition in IT instruction

Message ID 1268830567-3422-1-git-send-email-teofrastius@gmail.com
State New
Headers show

Commit Message

Johan Bengtsson March 17, 2010, 12:56 p.m. UTC
Do not try to insert a conditional jump over next instruction when the
condition code is AL as this will trigger an internal error.

Signed-off-by: Johan Bengtsson <teofrastius@gmail.com>
---
 target-arm/translate.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

Comments

Aurelien Jarno March 23, 2010, 9:28 p.m. UTC | #1
On Wed, Mar 17, 2010 at 01:56:07PM +0100, Johan Bengtsson wrote:
> Do not try to insert a conditional jump over next instruction when the
> condition code is AL as this will trigger an internal error.
> 
> Signed-off-by: Johan Bengtsson <teofrastius@gmail.com>

Thanks, applied.

> ---
>  target-arm/translate.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/target-arm/translate.c b/target-arm/translate.c
> index 786c329..554583d 100644
> --- a/target-arm/translate.c
> +++ b/target-arm/translate.c
> @@ -8328,9 +8328,11 @@ static void disas_thumb_insn(CPUState *env, DisasContext *s)
>  
>      if (s->condexec_mask) {
>          cond = s->condexec_cond;
> -        s->condlabel = gen_new_label();
> -        gen_test_cc(cond ^ 1, s->condlabel);
> -        s->condjmp = 1;
> +        if (cond != 0x0e) {     /* Skip conditional when condition is AL. */
> +          s->condlabel = gen_new_label();
> +          gen_test_cc(cond ^ 1, s->condlabel);
> +          s->condjmp = 1;
> +        }
>      }
>  
>      insn = lduw_code(s->pc);
> -- 
> 1.6.3.3
> 
> 
> 
>
diff mbox

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 786c329..554583d 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -8328,9 +8328,11 @@  static void disas_thumb_insn(CPUState *env, DisasContext *s)
 
     if (s->condexec_mask) {
         cond = s->condexec_cond;
-        s->condlabel = gen_new_label();
-        gen_test_cc(cond ^ 1, s->condlabel);
-        s->condjmp = 1;
+        if (cond != 0x0e) {     /* Skip conditional when condition is AL. */
+          s->condlabel = gen_new_label();
+          gen_test_cc(cond ^ 1, s->condlabel);
+          s->condjmp = 1;
+        }
     }
 
     insn = lduw_code(s->pc);