diff options
author | Michael Meissner <gnu@the-meissners.org> | 1996-09-15 03:46:52 +0000 |
---|---|---|
committer | Michael Meissner <gnu@the-meissners.org> | 1996-09-15 03:46:52 +0000 |
commit | 215ac9533cc93f7de6c769c7da8fe8781a175b37 (patch) | |
tree | 4a016166eee034bc62618bfd4259c32b2dff2ac9 /sim/d10v/interp.c | |
parent | ad0d14e7a21a002e88d23c7b7aa417ad27fe534e (diff) | |
download | gdb-215ac9533cc93f7de6c769c7da8fe8781a175b37.zip gdb-215ac9533cc93f7de6c769c7da8fe8781a175b37.tar.gz gdb-215ac9533cc93f7de6c769c7da8fe8781a175b37.tar.bz2 |
Fix brf0{t,f}.s <label> -> instruction not to execute instruction if branch succeeds
Diffstat (limited to 'sim/d10v/interp.c')
-rw-r--r-- | sim/d10v/interp.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c index 38b4d4c..f035cf0 100644 --- a/sim/d10v/interp.c +++ b/sim/d10v/interp.c @@ -158,12 +158,15 @@ do_long (ins) ins_type_counters[ (int)State.ins_type ]++; (h->ops->func)(); } + static void do_2_short (ins1, ins2, leftright) uint16 ins1, ins2; enum _leftright leftright; { struct hash_entry *h; + reg_t orig_pc = PC; + #ifdef DEBUG if ((d10v_debug & DEBUG_INSTRUCTION) != 0) (*d10v_callback->printf_filtered) (d10v_callback, "do_2_short 0x%x (%s) -> 0x%x\n", @@ -175,12 +178,18 @@ do_2_short (ins1, ins2, leftright) State.ins_type = (leftright == LEFT_FIRST) ? INS_LEFT : INS_RIGHT; ins_type_counters[ (int)State.ins_type ]++; (h->ops->func)(); - h = lookup_hash (ins2, 0); - get_operands (h->ops, ins2); - State.ins_type = (leftright == LEFT_FIRST) ? INS_RIGHT : INS_LEFT; - ins_type_counters[ (int)State.ins_type ]++; - (h->ops->func)(); + + /* If the PC has changed (ie, a jump), don't do the second instruction */ + if (orig_pc == PC) + { + h = lookup_hash (ins2, 0); + get_operands (h->ops, ins2); + State.ins_type = (leftright == LEFT_FIRST) ? INS_RIGHT : INS_LEFT; + ins_type_counters[ (int)State.ins_type ]++; + (h->ops->func)(); + } } + static void do_parallel (ins1, ins2) uint16 ins1, ins2; |