From fe20c8cd74b0fe062a03e5429323d21594e1bb4a Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 27 Jul 2000 09:39:50 +0000 Subject: [PATCH] * compile.c (decode): Distinguish inc/dec.[wl] and adds/subs correctly. --- sim/h8300/ChangeLog | 5 +++++ sim/h8300/compile.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index e3885dedb7..46f9972287 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,3 +1,8 @@ +2000-06-15 Kazu Hirata + + * compile.c (decode): Distinguish inc/dec.[wl] and adds/subs + correctly. + 2000-06-20 Frank Ch. Eigler * compile.c: Don't include "wait.h". diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index bbd28e5008..3a22190fef 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -219,7 +219,10 @@ decode (addr, data, dst) if (looking_for & DBIT) { - if ((looking_for & 5) != (thisnib & 5)) + /* Exclude adds/subs by looking at bit 0 and 2, and + make sure the operand size, either w or l, + matches by looking at bit 1. */ + if ((looking_for & 7) != (thisnib & 7)) goto fail; abs = (thisnib & 0x8) ? 2 : 1; @@ -292,6 +295,8 @@ decode (addr, data, dst) case 0: abs = 1; break; + default: + goto fail; } } else if (looking_for & L_8) -- 2.11.0