Patchwork [22/23] target-sparc: Fall through from not-taken trap

login
register
mail settings
Submitter Richard Henderson
Date Oct. 5, 2012, 11:55 p.m.
Message ID <1349481310-9237-23-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/189635/
State New
Headers show

Comments

Richard Henderson - Oct. 5, 2012, 11:55 p.m.
Now that we've cleaned up global temporary allocation, we can
continue translating the fallthru path of a conditional trap.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-sparc/translate.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Patch

diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 48c245e..a7f6407 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -2573,13 +2573,15 @@  static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
                 gen_helper_raise_exception(cpu_env, trap);
                 tcg_temp_free_i32(trap);
 
-                if (cond != 8) {
+                if (cond == 8) {
+                    /* An unconditional trap ends the TB.  */
+                    dc->is_br = 1;
+                    goto jmp_insn;
+                } else {
+                    /* A conditional trap falls through to the next insn.  */
                     gen_set_label(l1);
-                    gen_op_next_insn();
-                    tcg_gen_exit_tb(0);
+                    break;
                 }
-                dc->is_br = 1;
-                goto jmp_insn;
             } else if (xop == 0x28) {
                 rs1 = GET_FIELD(insn, 13, 17);
                 switch(rs1) {